Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
attempting to fix #29
Browse files Browse the repository at this point in the history
  • Loading branch information
savageautomate committed Jan 8, 2013
1 parent 9e727fb commit c5fa25e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Spi_wiringPiSPIDataRW__I_3BI
// copy the bytes from the data array argument into a native character buffer
jbyte *body = (*env)->GetByteArrayElements(env, data, 0);
for (i = 0; i < length; i++) {
buffer[i] = body[i + offset];
buffer[i] = body[i];
}

jint result = wiringPiSPIDataRW(channel, (unsigned char *)buffer, length);
Expand All @@ -82,7 +82,7 @@ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Spi_wiringPiSPIDataRW__I_3BI
for (i = 0; i < length; i++) {
body[i] = buffer[i];
}
(*env)->ReleaseByteArrayElements(env, data, bodyReturn, 0);
(*env)->ReleaseByteArrayElements(env, data, body, 0);

return result;
}
Expand Down
4 changes: 1 addition & 3 deletions pi4j-native/src/main/native/wiringpi-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# limitations under the License.
# #L%
###

# ----------------------------------
# install prerequisites
# ----------------------------------
Expand All @@ -36,7 +35,6 @@ sudo apt-get install git-core -y
# ----------------------------------
git clone git://github.com/WiringPi/WiringPi.git wiringPi
cd wiringPi
git pull origin

# ----------------------------------
# uninstall any previous copies
Expand All @@ -48,4 +46,4 @@ sudo make uninstall
# build latest wiringPi
# ----------------------------------
cd ..
./build
./build

0 comments on commit c5fa25e

Please sign in to comment.