![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rtos API example
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "USBHID.h" 00003 00004 //We declare a USBHID device 00005 USBHID hid; 00006 00007 //This report will contain data to be sent 00008 HID_REPORT send_report; 00009 00010 Ticker tic; 00011 00012 void tic_handler(); 00013 void tic_handler() { 00014 hid.send(&send_report); 00015 } 00016 00017 int main(void) { 00018 //Fill the report 00019 for(int i = 0; i < 64; i++) 00020 send_report.data[i] = i; 00021 send_report.length = 64; 00022 00023 tic.attach(tic_handler, 1); 00024 00025 while (1); 00026 }
Generated on Sun Jul 17 2022 08:25:26 by
![doxygen](doxygen.png)