Skip to content

Commit

Permalink
#25 Missed a hard-coded channel reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjlewis committed Oct 30, 2017
1 parent 26413b0 commit 27586d7
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ JNIEXPORT jobject JNICALL Java_com_diozero_ws281xj_WS281xNative_initialise(
return NULL;
}

jobject direct_buffer = (*env)->NewDirectByteBuffer(env, led_string.channel[0].leds, numLeds*sizeof(ws2811_led_t));
jobject direct_buffer = (*env)->NewDirectByteBuffer(env, led_string.channel[channel].leds, numLeds*sizeof(ws2811_led_t));

return direct_buffer;
}
Expand All @@ -83,17 +83,3 @@ JNIEXPORT void JNICALL Java_com_diozero_ws281xj_WS281xNative_terminate(JNIEnv* e
JNIEXPORT jint JNICALL Java_com_diozero_ws281xj_WS281xNative_render(JNIEnv* env, jclass clz) {
return ws2811_render(&led_string);
}

int main(int argc, char *argv[]) {
printf("Hello\n");
int rc = ws2811_init(&led_string);
if (rc != 0) {
printf("Error %d\n", rc);
return -1;
}
printf("led_string.channel[0].gpionum=%d\n", led_string.channel[0].gpionum);
printf("led_string.channel[0].strip_type=%d\n", led_string.channel[0].strip_type);
ws2811_fini(&led_string);

return 0;
}

0 comments on commit 27586d7

Please sign in to comment.