add neopixel support

This commit is contained in:
hathach
2018-11-23 15:00:59 +07:00
parent 4f48b8b51a
commit 12d68f592c
3 changed files with 132 additions and 19 deletions

View File

@ -46,6 +46,8 @@
#include "tusb.h"
#include "usb_desc.h"
#include "boards.h"
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
@ -155,11 +157,17 @@ void usb_teardown(void)
//--------------------------------------------------------------------+
void tud_mount_cb(void)
{
#ifdef LED_NEOPIXEL
uint8_t grb[] = { 255, 0, 0 };
neopixel_write(grb);
#endif
}
void tud_umount_cb(void)
{
#ifdef LED_NEOPIXEL
uint8_t grb[] = { 0, 255, 0 };
neopixel_write(grb);
#endif
}