Skip to content

Commit

Permalink
[bsp][nrf5x]added the cherryusb adapter for nrf52840
Browse files Browse the repository at this point in the history
  • Loading branch information
hydevcode committed Jan 24, 2025
1 parent cf199f5 commit e182a22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bsp/nrf5x/nrf52840/board/port/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ src = []
path = []

if GetDepend(['RT_USING_CHERRYUSB']):
src += Glob('cherryusb/cherryusb_usbd_compostite_init.c')
src += Glob('cherryusb/cherryusb.c')
path += [cwd + '/cherryusb']

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,22 @@ void usb_low_disable_irq(void)
{
NVIC_DisableIRQ(USBD_IRQn);
}

int cherryusb_protocol_stack_init(void)
{
#ifdef RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM
extern void cdc_acm_init(void);
cdc_acm_init();
rt_kprintf("cdc acm example started. \r\n");
nrf_delay_ms(5000);
#elif defined RT_CHERRYUSB_DEVICE_TEMPLATE_MSC
extern void msc_ram_init(void);
msc_ram_init();
rt_kprintf("msc ram example started. \r\n");
nrf_delay_ms(5000);
#elif defined RT_CHERRYUSB_DEVICE_TEMPLATE_HID_KEYBOARD
extern void hid_keyboard_init(uint8_t busid, uintptr_t reg_base);
hid_keyboard_init(0,NULL);
rt_kprintf("hid keyboard example started. \r\n");
// nrf_delay_ms(5000);
#endif
}

INIT_APP_EXPORT(cherryusb_protocol_stack_init);

0 comments on commit e182a22

Please sign in to comment.