Skip to content

Instantly share code, notes, and snippets.

@ateska
Last active February 8, 2017 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateska/58245d8a2b7e4721ea442a2eef5ff614 to your computer and use it in GitHub Desktop.
Save ateska/58245d8a2b7e4721ea442a2eef5ff614 to your computer and use it in GitHub Desktop.
#include <bc_common.h>
#include <bc_scheduler.h>
#include <bc_usb_cdc.h>
void application_on_tick(void *event_param)
{
// Send 'Hello world!' string to USB
char buffer[] = "Hello world!\r\n";
bc_usb_cdc_write(buffer, strlen(buffer));
// Reschedule this task to execute again (and again ...)
bc_scheduler_plan_current_relative(1000);
}
void application_init(void)
{
// Initialise USB subsystem
bc_usb_cdc_init();
// Schedule print to USB task
bc_scheduler_register(application_on_tick, NULL, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment