summaryrefslogtreecommitdiff
path: root/software/mpu
diff options
context:
space:
mode:
Diffstat (limited to 'software/mpu')
-rw-r--r--software/mpu/board/board.h16
-rw-r--r--software/mpu/heartbeat.c8
-rw-r--r--software/mpu/usb-cdc-shell.c2
3 files changed, 12 insertions, 14 deletions
diff --git a/software/mpu/board/board.h b/software/mpu/board/board.h
index 3004909..465a864 100644
--- a/software/mpu/board/board.h
+++ b/software/mpu/board/board.h
@@ -41,10 +41,8 @@
/*
* IO pins assignments.
*/
-#define LED__PIN 8
-#define LED__PORT GPIOA
-#define USB_DISC__PIN 13
-#define USB_DISC__PORT GPIOA
+#define GPIOA_LED 8
+#define GPIOA_USB_DISC 13
/*
* I/O ports initial setup, this configuration is established soon after reset
@@ -133,14 +131,12 @@
#define VAL_GPIOGODR 0xFFFFFFFF
/*
- * USB bus activation macro, required by the USB driver.
+ * These macros are needed by the USB driver but for compatibility
+ * with STM32F405-style processors not used.
*/
-#define usb_lld_connect_bus(usbp) palClearPad(USB_DISC__PORT, USB_DISC__PIN)
+#define usb_lld_connect_bus(usbp)
+#define usb_lld_disconnect_bus(usbp)
-/*
- * USB bus de-activation macro, required by the USB driver.
- */
-#define usb_lld_disconnect_bus(usbp) palSetPad(USB_DISC__PORT, USB_DISC__PIN)
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
diff --git a/software/mpu/heartbeat.c b/software/mpu/heartbeat.c
index 120fe48..21a3375 100644
--- a/software/mpu/heartbeat.c
+++ b/software/mpu/heartbeat.c
@@ -41,13 +41,13 @@ static msg_t Heartbeat(void *arg)
(void)arg;
chRegSetThreadName("heartbeat");
while (TRUE) {
- palClearPad(LED__PORT, LED__PIN);
+ palClearPad(GPIOA, GPIOA_LED);
chThdSleepMilliseconds(50);
- palSetPad(LED__PORT, LED__PIN);
+ palSetPad(GPIOA, GPIOA_LED);
chThdSleepMilliseconds(50);
- palClearPad(LED__PORT, LED__PIN);
+ palClearPad(GPIOA, GPIOA_LED);
chThdSleepMilliseconds(50);
- palSetPad(LED__PORT, LED__PIN);
+ palSetPad(GPIOA, GPIOA_LED);
chThdSleepMilliseconds(850);
}
}
diff --git a/software/mpu/usb-cdc-shell.c b/software/mpu/usb-cdc-shell.c
index 9aa2f41..3a8fb70 100644
--- a/software/mpu/usb-cdc-shell.c
+++ b/software/mpu/usb-cdc-shell.c
@@ -282,10 +282,12 @@ void usbCDCShellInit(void)
sduObjectInit(&SDU1);
sduStart(&SDU1, &serusbcfg);
+ palSetPad(GPIOA, GPIOA_USB_DISC);
usbDisconnectBus(serusbcfg.usbp);
chThdSleepMilliseconds(1500);
usbStart(serusbcfg.usbp, &usbcfg);
usbConnectBus(serusbcfg.usbp);
+ palClearPad(GPIOA, GPIOA_USB_DISC);
shellInit();
}