1
0

STM32F103x fixes.

This commit is contained in:
flabbergast 2015-12-03 09:24:49 +00:00
parent b110884a6d
commit 7aab3bb21a
4 changed files with 12 additions and 15 deletions

View File

@ -20,9 +20,9 @@ endif
CONFIG_H = config.h
# GENERIC STM32F103C8T6 board - stm32duino bootloader
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
# MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
# BOARD = GENERIC_STM32_F103
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = GENERIC_STM32_F103
# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
# OPT_DEFS =
@ -30,9 +30,9 @@ CONFIG_H = config.h
# BOARD = GENERIC_STM32_F103
# MAPLE MINI
OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
MCU_LDSCRIPT = STM32F103xE_maplemini_bootloader
BOARD = MAPLEMINI_STM32_F103
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
# MCU_LDSCRIPT = STM32F103xE_maplemini_bootloader
# BOARD = MAPLEMINI_STM32_F103
## chip/board settings
# the next two should match the directories in

View File

@ -143,7 +143,7 @@
/*
#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
*/
#define usb_lld_connect_bus(usbp)
#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
/*
* USB bus de-activation macro, required by the USB driver.
@ -151,7 +151,7 @@
/*
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
*/
#define usb_lld_disconnect_bus(usbp)
#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
#if !defined(_FROM_ASM_)
#ifdef __cplusplus

View File

@ -24,23 +24,20 @@ void led_set(uint8_t usb_led)
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
/* generic STM32F103C8T6 board */
#ifdef BOARD_GENERIC_STM32_F103
palSetPadMode(GPIOC, 13, PAL_MODE_OUTPUT_PUSHPULL);
palClearPad(GPIOC, 13);
#endif
/* Maple Mini */
#ifdef BOARD_MAPLEMINI_STM32_F103
palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(GPIOB, 1);
#endif
} else {
// Hi-Z
/* generic STM32F103C8T6 board */
#ifdef BOARD_GENERIC_STM32_F103
palSetPadMode(GPIOC, 13, PAL_MODE_INPUT);
palSetPad(GPIOC, 13);
#endif
/* Maple Mini */
#ifdef BOARD_MAPLEMINI_STM32_F103
palSetPadMode(GPIOB, 1, PAL_MODE_INPUT);
palClearPad(GPIOB,1);
#endif
}
}

View File

@ -63,8 +63,8 @@ uint8_t matrix_cols(void)
/* Maple Mini */
#ifdef BOARD_MAPLEMINI_STM32_F103
#define LED_ON() do { palClearPad(GPIOB, 1) ;} while (0)
#define LED_OFF() do { palSetPad(GPIOB, 1); } while (0)
#define LED_ON() do { palSetPad(GPIOB, 1) ;} while (0)
#define LED_OFF() do { palClearPad(GPIOB, 1); } while (0)
#define LED_TGL() do { palTogglePad(GPIOB, 1); } while (0)
#endif