aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test-session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test-session.cpp')
-rw-r--r--examples/test-session.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/examples/test-session.cpp b/examples/test-session.cpp
index 72d64d6..a147e06 100644
--- a/examples/test-session.cpp
+++ b/examples/test-session.cpp
@@ -20,7 +20,7 @@
int rate = 0;
-#if defined(BOARD_maple)
+#if defined(BOARD_maple) || defined(BOARD_maple_RET6)
const uint8 pwm_pins[] =
{0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 25, 27, 28};
const uint8 adc_pins[] =
@@ -351,22 +351,22 @@ void cmd_everything(void) { // TODO
}
void fast_gpio(int maple_pin) {
- GPIO_Port *port = PIN_MAP[maple_pin].port;
+ gpio_dev *dev = PIN_MAP[maple_pin].gpio_device;
uint32 pin = PIN_MAP[maple_pin].pin;
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
- gpio_write_bit(port, pin, 1); gpio_write_bit(port, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
+ gpio_write_bit(dev, pin, 1); gpio_write_bit(dev, pin, 0);
}
void cmd_serial1_serial3(void) {
@@ -617,15 +617,14 @@ void init_all_timers(uint16 prescale) {
timer_init(TIMER4, prescale);
#ifdef STM32_HIGH_DENSITY
timer_init(TIMER5, prescale);
- timer_init(TIMER6, prescale);
- timer_init(TIMER7, prescale);
+ // timer_init(TIMER6, prescale);
+ // timer_init(TIMER7, prescale);
timer_init(TIMER8, prescale);
#endif
}
-
// Force init to be called *first*, i.e. before static object allocation.
-// Otherwise, statically allocated object that need libmaple may fail.
+// Otherwise, statically allocated objects that need libmaple may fail.
__attribute__(( constructor )) void premain() {
init();
}