aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-04-11 20:45:35 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-04-11 20:45:47 -0400
commit4a56b462cfa7c54c623374f966b853a7b0790613 (patch)
treed36cd023ce71bde96ea71f408fc1e308dd1ffb14
parent57b59731b712e8edb89e65de6f7b02555d0832d9 (diff)
downloadlibrambutan-4a56b462cfa7c54c623374f966b853a7b0790613.tar.gz
librambutan-4a56b462cfa7c54c623374f966b853a7b0790613.zip
Resolving some FIXMEs.
-rw-r--r--examples/test-session.cpp10
-rw-r--r--examples/vga-scope.cpp7
-rw-r--r--libmaple/usb/usb.c24
-rw-r--r--libmaple/usb/usb_config.h2
4 files changed, 17 insertions, 26 deletions
diff --git a/examples/test-session.cpp b/examples/test-session.cpp
index 03fb248..01dd184 100644
--- a/examples/test-session.cpp
+++ b/examples/test-session.cpp
@@ -780,17 +780,23 @@ void init_all_timers(uint16 prescale) {
}
void enable_usarts(void) {
- // FIXME generalize after USART refactor
Serial1.begin(BAUD);
Serial2.begin(BAUD);
Serial3.begin(BAUD);
+#ifdef STM32_HIGH_DENSITY
+ Serial4.begin(BAUD);
+ Serial5.begin(BAUD);
+#endif
}
void disable_usarts(void) {
- // FIXME generalize after USART refactor
Serial1.end();
Serial2.end();
Serial3.end();
+#ifdef STM32_HIGH_DENSITY
+ Serial4.end();
+ Serial5.end();
+#endif
}
void print_board_array(const char* msg, const uint8 arr[], int len) {
diff --git a/examples/vga-scope.cpp b/examples/vga-scope.cpp
index 9c6dca5..66e72e9 100644
--- a/examples/vga-scope.cpp
+++ b/examples/vga-scope.cpp
@@ -28,12 +28,17 @@
- http://www.epanorama.net/documents/pc/vga_timing.html
This code is released into the public domain.
+
+ Authors:
+
+ Bryan Newbold <bnewbold@leaflabs.com>
+ Marti Bolivar <mbolivar@leaflabs.com>
*/
#include "wirish.h"
#include "systick.h"
-// FIXME generalize for Native and Mini
+// FIXME: generalize for Native and Mini
#define LED_PIN BOARD_LED_PIN
#define ANALOG_PIN 18
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c
index 2fc4eb2..7b1dd4c 100644
--- a/libmaple/usb/usb.c
+++ b/libmaple/usb/usb.c
@@ -35,6 +35,7 @@
#include "usb_lib.h"
#include "gpio.h"
#include "usb_hardware.h"
+#include "delay.h"
#include "usb_config.h"
#include "usb_callbacks.h"
@@ -318,29 +319,8 @@ if (wIstr & ISTR_CTR & wInterrupt_Mask) {
}
-static void FIXME_delayMicroseconds_copy(uint32 us) {
- /* So (2^32)/12 micros max, or less than 6 minutes */
- us *= 12;
-
- /* fudge for function call overhead */
- us--;
- asm volatile(" mov r0, %[us] \n\t"
- "1: subs r0, #1 \n\t"
- " bhi 1b \n\t"
- :
- : [us] "r" (us)
- : "r0");
-}
-
-static void FIXME_delay_copy(unsigned long ms) {
- uint32 i;
- for (i = 0; i < ms; i++) {
- FIXME_delayMicroseconds_copy(1000);
- }
-}
-
void usbWaitReset(void) {
- FIXME_delay_copy(RESET_DELAY);
+ delay_us(RESET_DELAY);
systemHardReset();
}
diff --git a/libmaple/usb/usb_config.h b/libmaple/usb/usb_config.h
index 0860b90..23b49ee 100644
--- a/libmaple/usb/usb_config.h
+++ b/libmaple/usb/usb_config.h
@@ -25,7 +25,7 @@
*****************************************************************************/
#define VCOM_ID_VENDOR 0x1EAF
-#define RESET_DELAY (100)
+#define RESET_DELAY (100000)
#define USB_CONFIG_MAX_POWER (100 >> 1)
#if defined(BOARD_maple) || defined(BOARD_maple_RET6)