From a5549d630c3c261e7d52cb245d945e54f011a3e7 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Thu, 16 Oct 2014 13:19:34 -0700 Subject: Whitespace cleanup. --- src/platforms/native/platform.c | 26 +++++++++--------- src/platforms/native/platform.h | 58 ++++++++++++++++++++--------------------- src/platforms/native/usbdfu.c | 2 +- 3 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src/platforms/native') diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c index 66b84fa..2789d8c 100644 --- a/src/platforms/native/platform.c +++ b/src/platforms/native/platform.c @@ -110,14 +110,13 @@ int platform_init(void) : GPIO_CNF_OUTPUT_OPENDRAIN), SRST_PIN); - /* Enable internal pull-up on PWR_BR so that we don't drive - TPWR locally or inadvertently supply power to the target. */ - if (platform_hwversion () > 0) { - gpio_set (PWR_BR_PORT, PWR_BR_PIN); - gpio_set_mode(PWR_BR_PORT, GPIO_MODE_INPUT, - GPIO_CNF_INPUT_PULL_UPDOWN, - PWR_BR_PIN); - } + /* Enable internal pull-up on PWR_BR so that we don't drive + TPWR locally or inadvertently supply power to the target. */ + if (platform_hwversion () > 0) { + gpio_set (PWR_BR_PORT, PWR_BR_PIN); + gpio_set_mode(PWR_BR_PORT, GPIO_MODE_INPUT, + GPIO_CNF_INPUT_PULL_UPDOWN, PWR_BR_PIN); + } /* Setup heartbeat timer */ systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8); @@ -134,15 +133,16 @@ int platform_init(void) gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO0); } - - SCB_VTOR = 0x2000; // Relocate interrupt vector table here + /* Relocate interrupt vector table here */ + SCB_VTOR = 0x2000; cdcacm_init(); usbuart_init(); - // Set recovery point + /* Set recovery point */ if (setjmp(fatal_error_jmpbuf)) { - return 0; // Do nothing on failure + /* Do nothing on failure */ + return 0; } jtag_scan(NULL); @@ -162,7 +162,7 @@ bool platform_target_get_power(void) { if (platform_hwversion() > 0) { return gpio_get(PWR_BR_PORT, PWR_BR_PIN); } - return 1; // 1 = Unpowered + return 1; /* 1 = Unpowered */ } void platform_target_set_power(bool power) { diff --git a/src/platforms/native/platform.h b/src/platforms/native/platform.h index 3bbcd17..81a2a4b 100644 --- a/src/platforms/native/platform.h +++ b/src/platforms/native/platform.h @@ -41,11 +41,11 @@ #define PLATFORM_HAS_TRACESWO #define PLATFORM_HAS_POWER_SWITCH #define BOARD_IDENT "Black Magic Probe" -#define BOARD_IDENT_DFU "Black Magic Probe (Upgrade)" -#define BOARD_IDENT_UPD "Black Magic Probe (DFU Upgrade)" +#define BOARD_IDENT_DFU "Black Magic Probe (Upgrade)" +#define BOARD_IDENT_UPD "Black Magic Probe (DFU Upgrade)" #define DFU_IDENT "Black Magic Firmware Upgrade" -#define DFU_IFACE_STRING "@Internal Flash /0x08000000/8*001Ka,120*001Kg" -#define UPD_IFACE_STRING "@Internal Flash /0x08000000/8*001Kg" +#define DFU_IFACE_STRING "@Internal Flash /0x08000000/8*001Ka,120*001Kg" +#define UPD_IFACE_STRING "@Internal Flash /0x08000000/8*001Kg" extern usbd_device *usbdev; #define CDCACM_GDB_ENDPOINT 1 @@ -109,35 +109,35 @@ extern usbd_device *usbdev; #define LED_IDLE_RUN GPIO10 #define LED_ERROR GPIO11 -#define TMS_SET_MODE() \ - gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ - GPIO_CNF_OUTPUT_PUSHPULL, TMS_PIN); -#define SWDIO_MODE_FLOAT() \ - gpio_set_mode(SWDIO_PORT, GPIO_MODE_INPUT, \ - GPIO_CNF_INPUT_FLOAT, SWDIO_PIN); -#define SWDIO_MODE_DRIVE() \ - gpio_set_mode(SWDIO_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ - GPIO_CNF_OUTPUT_PUSHPULL, SWDIO_PIN); - -#define UART_PIN_SETUP() \ - gpio_set_mode(USBUSART_PORT, GPIO_MODE_OUTPUT_2_MHZ, \ - GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); - -#define SRST_SET_VAL(x) \ - platform_srst_set_val(x) - -#define USB_DRIVER stm32f103_usb_driver -#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ -#define USB_ISR usb_lp_can_rx0_isr +#define TMS_SET_MODE() \ + gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ + GPIO_CNF_OUTPUT_PUSHPULL, TMS_PIN); +#define SWDIO_MODE_FLOAT() \ + gpio_set_mode(SWDIO_PORT, GPIO_MODE_INPUT, \ + GPIO_CNF_INPUT_FLOAT, SWDIO_PIN); +#define SWDIO_MODE_DRIVE() \ + gpio_set_mode(SWDIO_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ + GPIO_CNF_OUTPUT_PUSHPULL, SWDIO_PIN); + +#define UART_PIN_SETUP() \ + gpio_set_mode(USBUSART_PORT, GPIO_MODE_OUTPUT_2_MHZ, \ + GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); + +#define SRST_SET_VAL(x) \ + platform_srst_set_val(x) + +#define USB_DRIVER stm32f103_usb_driver +#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ +#define USB_ISR usb_lp_can_rx0_isr /* Interrupt priorities. Low numbers are high priority. * For now USART1 preempts USB which may spin while buffer is drained. * TIM3 is used for traceswo capture and must be highest priority. */ -#define IRQ_PRI_USB (2 << 4) -#define IRQ_PRI_USBUSART (1 << 4) -#define IRQ_PRI_USBUSART_TIM (3 << 4) -#define IRQ_PRI_USB_VBUS (14 << 4) -#define IRQ_PRI_TRACE (0 << 4) +#define IRQ_PRI_USB (2 << 4) +#define IRQ_PRI_USBUSART (1 << 4) +#define IRQ_PRI_USBUSART_TIM (3 << 4) +#define IRQ_PRI_USB_VBUS (14 << 4) +#define IRQ_PRI_TRACE (0 << 4) #define USBUSART USART1 #define USBUSART_CR1 USART1_CR1 diff --git a/src/platforms/native/usbdfu.c b/src/platforms/native/usbdfu.c index 3aac079..39643da 100644 --- a/src/platforms/native/usbdfu.c +++ b/src/platforms/native/usbdfu.c @@ -29,7 +29,7 @@ uint32_t app_address = 0x08002000; void dfu_detach(void) { - /* USB device must detach, we just reset... */ + /* USB device must detach, we just reset... */ scb_reset_system(); } -- cgit v1.2.3