Skip to content

Commit

Permalink
add: add interrupt-based demo for F429
Browse files Browse the repository at this point in the history
add: add doxygen description for USBD_SOF_OUT preprocessor variable
rmv: remove MCO clockout for F429 in cdc_startup.c (was added for debug purposes)
upd: update makefile for F429

Github issue #9
  • Loading branch information
dmitrystu committed Feb 2, 2018
1 parent 0ae2d92 commit 4fcd0c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ help all:
@echo ' 32l476rg-nucleo'
@echo ' stm32l476rg CDC loopback demo for STM32L476xG based boards'
@echo ' stm32l052x8 CDC loopback demo for STM32L052x8 based boards'
@echo ' 32f429zi-nucleo'
@echo ' stm32f429xi CDC loopback demo for STM32F429xI based boards'
@echo ' doc DOXYGEN documentation'
@echo ' module static library module using following envars (defaults)'
@echo ' MODULE module name (libusb.a)'
Expand Down
3 changes: 3 additions & 0 deletions demo/cdc_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ static void cdc_init_usbd(void) {
#elif defined(STM32F103x6)
#define USB_HANDLER USB_LP_CAN1_RX0_IRQHandler
#define USB_NVIC_IRQ USB_LP_CAN1_RX0_IRQn
#elif defined(STM32F429xx)
#define USB_HANDLER OTG_FS_IRQHandler
#define USB_NVIC_IRQ OTG_FS_IRQn
#else
#error Not supported
#endif
Expand Down
6 changes: 1 addition & 5 deletions demo/cdc_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ static void cdc_init_rcc (void) {
_BST(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN);
_BST(GPIOA->AFR[1], (0x0A << 12) | (0x0A << 16));
_BMD(GPIOA->MODER, (0x03 << 22) | (0x03 << 24), (0x02 << 22) | (0x02 << 24));

_BST(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);
_BMD(GPIOC->MODER, (0x03 << 18), (0x02 << 18));
_BMD(RCC->CFGR, RCC_CFGR_MCO2, RCC_CFGR_MCO2PRE_2);

#endif
#else
#error Not supported
#endif
Expand Down
3 changes: 2 additions & 1 deletion inc/usbd_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
/**\name Compile-time control macros
* @{ */
#define USBD_SOF_DISABLED /**<\brief Disables SOF handling.*/
#define USBD_VBUS_DETECT /**<\brief Enables Vbus detection for V2 driver.*/
#define USBD_VBUS_DETECT /**<\brief Enables Vbus detection for L4/F4 driver.*/
#define USBD_DP_PORT /**<\brief DP pullup port for F103/F303 driver.*/
#define USBD_DP_PIN /**<\brief DP pullup pin for F103/F303 driver.*/
#define USBD_SOF_OUT /**<\brief Enables SOF output pin for F4 OTGFS. */
/** @} */
#endif

Expand Down

0 comments on commit 4fcd0c4

Please sign in to comment.