altos/stm: Make beeper driver support all possible tim234 configs
authorKeith Packard <keithp@keithp.com>
Sat, 13 Oct 2018 20:42:34 +0000 (13:42 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 19 Oct 2018 15:38:32 +0000 (08:38 -0700)
And update all users to be explicit about the desired config.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 files changed:
src/easymega-v1.0/ao_pins.h
src/easymega-v2.0/ao_pins.h
src/stm/ao_beep_stm.c
src/stm/stm32l.h
src/teleballoon-v2.0/ao_pins.h
src/telefireeight-v1.0/ao_pins.h
src/telefireone-v1.0/ao_pins.h
src/telefiretwo-v0.2/ao_pins.h
src/telelco-v0.2-cc1200/ao_pins.h
src/telelco-v0.2/ao_pins.h
src/telelco-v0.3/ao_pins.h
src/telelco-v2.0/ao_pins.h
src/telelcotwo-v0.1/ao_pins.h
src/telemega-v0.1/ao_pins.h
src/telemega-v1.0/ao_pins.h
src/telemega-v2.0/ao_pins.h
src/telemega-v3.0/ao_pins.h
src/telemetrum-v2.0/ao_pins.h
src/telemetrum-v3.0/ao_pins.h
src/telemini-v3.0/ao_pins.h

index e7382e4bed21a34e8d37f9d75c7410181b55e6f2..bfa777c66401466a9348abd6f7a2c1da4687bc84 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              0
 #define HAS_TELEMETRY          0
index aff06cdd8dc9bdc66fc8abea3812b68e2cf03535..508c043cc44a8ebd1d445b333fc42358c7af000f 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           2
+#define BEEPER_CHANNEL         3
+#define BEEPER_PORT            (&stm_gpioa)
+#define BEEPER_PIN             2
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              0
 #define HAS_TELEMETRY          0
index f9fa14c29cfa60e5abbb8bea4386dd3e426a861a..2746d7f8e60b558e48056f2b3653daf237a6be2b 100644 (file)
 
 #include "ao.h"
 
-#ifndef BEEPER_CHANNEL
-#define BEEPER_CHANNEL 1
+#if BEEPER_TIMER == 2
+#define stm_beeper     stm_tim2
+#define RCC_BEEPER     STM_RCC_APB1ENR_TIM2EN
+#define BEEPER_AFR     STM_AFR_AF1
+#elif BEEPER_TIMER == 3
+#define stm_beeper     stm_tim3
+#define RCC_BEEPER     STM_RCC_APB1ENR_TIM3EN
+#define BEEPER_AFR     STM_AFR_AF2
+#elif BEEPER_TIMER == 4
+#define stm_beeper     stm_tim4
+#define RCC_BEEPER     STM_RCC_APB1ENR_TIM4EN
+#define BEEPER_AFR     STM_AFR_AF2
+#else
+#error BEEPER_TIMER must be 2, 3 or 4
 #endif
 
 void
 ao_beep(uint8_t beep)
 {
        if (beep == 0) {
-               stm_tim3.cr1 = 0;
-               stm_rcc.apb1enr &= ~(1 << STM_RCC_APB1ENR_TIM3EN);
+               stm_beeper.cr1 = 0;
+               stm_rcc.apb1enr &= ~(1 << RCC_BEEPER);
        } else {
-               stm_rcc.apb1enr |= (1 << STM_RCC_APB1ENR_TIM3EN);
+               stm_rcc.apb1enr |= (1 << RCC_BEEPER);
 
-               stm_tim3.cr2 = ((0 << STM_TIM234_CR2_TI1S) |
+               stm_beeper.cr2 = ((0 << STM_TIM234_CR2_TI1S) |
                                (STM_TIM234_CR2_MMS_RESET << STM_TIM234_CR2_MMS) |
                                (0 << STM_TIM234_CR2_CCDS));
 
                /* Set prescaler to match cc1111 clocks
                 */
-               stm_tim3.psc = AO_TIM23467_CLK / 750000;
+               stm_beeper.psc = AO_TIM23467_CLK / 750000;
 
                /* 1. Select the counter clock (internal, external, prescaler).
                 *
                 * Setting SMCR to zero means use the internal clock
                 */
 
-               stm_tim3.smcr = 0;
+               stm_beeper.smcr = 0;
 
                /* 2. Write the desired data in the TIMx_ARR and TIMx_CCRx registers. */
-               stm_tim3.arr = beep;
-               stm_tim3.ccr1 = beep;
+               stm_beeper.arr = beep;
+#if BEEPER_CHANNEL == 1
+               stm_beeper.ccr1 = beep;
+#elif BEEPER_CHANNEL == 2
+               stm_beeper.ccr2 = beep;
+#elif BEEPER_CHANNEL == 3
+               stm_beeper.ccr3 = beep;
+#elif BEEPER_CHANNEL == 4
+               stm_beeper.ccr4 = beep;
+#else
+#error invalid BEEPER_CHANNEL
+#endif
 
                /* 3. Set the CCxIE and/or CCxDE bits if an interrupt and/or a
                 * DMA request is to be generated.
@@ -61,63 +83,56 @@ ao_beep(uint8_t beep)
                 *  is enabled and active high.
                 */
 
-#if BEEPER_CHANNEL == 1
-               stm_tim3.ccmr1 = ((0 << STM_TIM234_CCMR1_OC2CE) |
-                                 (STM_TIM234_CCMR1_OC2M_FROZEN << STM_TIM234_CCMR1_OC2M) |
-                                 (0 << STM_TIM234_CCMR1_OC2PE) |
-                                 (0 << STM_TIM234_CCMR1_OC2FE) |
-                                 (STM_TIM234_CCMR1_CC2S_OUTPUT << STM_TIM234_CCMR1_CC2S) |
-
-                                 (0 << STM_TIM234_CCMR1_OC1CE) |
-                                 (STM_TIM234_CCMR1_OC1M_TOGGLE << STM_TIM234_CCMR1_OC1M) |
-                                 (0 << STM_TIM234_CCMR1_OC1PE) |
-                                 (0 << STM_TIM234_CCMR1_OC1FE) |
-                                 (STM_TIM234_CCMR1_CC1S_OUTPUT << STM_TIM234_CCMR1_CC1S));
-
-               stm_tim3.ccer = ((0 << STM_TIM234_CCER_CC4NP) |
-                                (0 << STM_TIM234_CCER_CC4P) |
-                                (0 << STM_TIM234_CCER_CC4E) |
-                                (0 << STM_TIM234_CCER_CC3NP) |
-                                (0 << STM_TIM234_CCER_CC3P) |
-                                (0 << STM_TIM234_CCER_CC3E) |
-                                (0 << STM_TIM234_CCER_CC2NP) |
-                                (0 << STM_TIM234_CCER_CC2P) |
-                                (0 << STM_TIM234_CCER_CC2E) |
-                                (0 << STM_TIM234_CCER_CC1NP) |
-                                (0 << STM_TIM234_CCER_CC1P) |
-                                (1 << STM_TIM234_CCER_CC1E));
+#define OC1M   (BEEPER_CHANNEL == 1 ? STM_TIM234_CCMR1_OC1M_TOGGLE : STM_TIM234_CCMR1_OC1M_FROZEN)
+#define OC2M   (BEEPER_CHANNEL == 2 ? STM_TIM234_CCMR1_OC2M_TOGGLE : STM_TIM234_CCMR1_OC2M_FROZEN)
+#define OC3M   (BEEPER_CHANNEL == 3 ? STM_TIM234_CCMR2_OC3M_TOGGLE : STM_TIM234_CCMR2_OC3M_FROZEN)
+#define OC4M   (BEEPER_CHANNEL == 4 ? STM_TIM234_CCMR2_OC4M_TOGGLE : STM_TIM234_CCMR2_OC4M_FROZEN)
+
+#define CCER(n)        (BEEPER_CHANNEL == (n) ? 1 : 0)
+
+#if BEEPER_CHANNEL == 1 || BEEPER_CHANNEL == 2
+               stm_beeper.ccmr1 = ((0 << STM_TIM234_CCMR1_OC2CE) |
+                                   (OC2M << STM_TIM234_CCMR1_OC2M) |
+                                   (0 << STM_TIM234_CCMR1_OC2PE) |
+                                   (0 << STM_TIM234_CCMR1_OC2FE) |
+                                   (STM_TIM234_CCMR1_CC2S_OUTPUT << STM_TIM234_CCMR1_CC2S) |
+
+                                   (0 << STM_TIM234_CCMR1_OC1CE) |
+                                   (OC1M << STM_TIM234_CCMR1_OC1M) |
+                                   (0 << STM_TIM234_CCMR1_OC1PE) |
+                                   (0 << STM_TIM234_CCMR1_OC1FE) |
+                                   (STM_TIM234_CCMR1_CC1S_OUTPUT << STM_TIM234_CCMR1_CC1S));
+#elif BEEPER_CHANNEL == 3 || BEEPER_CHANNEL == 4
+               stm_beeper.ccmr2 = ((0 << STM_TIM234_CCMR2_OC4CE) |
+                                   (OC4M << STM_TIM234_CCMR2_OC4M) |
+                                   (0 << STM_TIM234_CCMR2_OC4PE) |
+                                   (0 << STM_TIM234_CCMR2_OC4FE) |
+                                   (STM_TIM234_CCMR2_CC4S_OUTPUT << STM_TIM234_CCMR2_CC4S) |
+
+                                   (0 << STM_TIM234_CCMR2_OC3CE) |
+                                   (OC3M << STM_TIM234_CCMR2_OC3M) |
+                                   (0 << STM_TIM234_CCMR2_OC3PE) |
+                                   (0 << STM_TIM234_CCMR2_OC3FE) |
+                                   (STM_TIM234_CCMR2_CC3S_OUTPUT << STM_TIM234_CCMR2_CC3S));
+#else
+#error invalid BEEPER_CHANNEL
 #endif
-#if BEEPER_CHANNEL == 4
-               stm_tim3.ccmr2 = ((0 << STM_TIM234_CCMR2_OC4CE) |
-                                 (STM_TIM234_CCMR2_OC4M_TOGGLE << STM_TIM234_CCMR2_OC4M) |
-                                 (0 << STM_TIM234_CCMR2_OC4PE) |
-                                 (0 << STM_TIM234_CCMR2_OC4FE) |
-                                 (STM_TIM234_CCMR2_CC4S_OUTPUT << STM_TIM234_CCMR2_CC4S) |
-
-                                 (0 << STM_TIM234_CCMR2_OC3CE) |
-                                 (STM_TIM234_CCMR2_OC3M_FROZEN << STM_TIM234_CCMR2_OC3M) |
-                                 (0 << STM_TIM234_CCMR2_OC3PE) |
-                                 (0 << STM_TIM234_CCMR2_OC3FE) |
-                                 (STM_TIM234_CCMR2_CC3S_OUTPUT << STM_TIM234_CCMR2_CC3S));
-
-               stm_tim3.ccer = ((0 << STM_TIM234_CCER_CC4NP) |
-                                (0 << STM_TIM234_CCER_CC4P) |
-                                (1 << STM_TIM234_CCER_CC4E) |
-                                (0 << STM_TIM234_CCER_CC3NP) |
-                                (0 << STM_TIM234_CCER_CC3P) |
-                                (0 << STM_TIM234_CCER_CC3E) |
-                                (0 << STM_TIM234_CCER_CC2NP) |
-                                (0 << STM_TIM234_CCER_CC2P) |
-                                (0 << STM_TIM234_CCER_CC2E) |
-                                (0 << STM_TIM234_CCER_CC1NP) |
-                                (0 << STM_TIM234_CCER_CC1P) |
-                                (0 << STM_TIM234_CCER_CC1E));
-#endif
-
+               stm_beeper.ccer = ((0 << STM_TIM234_CCER_CC4NP) |
+                                  (0 << STM_TIM234_CCER_CC4P) |
+                                  (CCER(4) << STM_TIM234_CCER_CC4E) |
+                                  (0 << STM_TIM234_CCER_CC3NP) |
+                                  (0 << STM_TIM234_CCER_CC3P) |
+                                  (CCER(3) << STM_TIM234_CCER_CC3E) |
+                                  (0 << STM_TIM234_CCER_CC2NP) |
+                                  (0 << STM_TIM234_CCER_CC2P) |
+                                  (CCER(2) << STM_TIM234_CCER_CC2E) |
+                                  (0 << STM_TIM234_CCER_CC1NP) |
+                                  (0 << STM_TIM234_CCER_CC1P) |
+                                  (CCER(1) << STM_TIM234_CCER_CC1E));
 
                /* 5. Enable the counter by setting the CEN bit in the TIMx_CR1 register. */
 
-               stm_tim3.cr1 = ((STM_TIM234_CR1_CKD_1 << STM_TIM234_CR1_CKD) |
+               stm_beeper.cr1 = ((STM_TIM234_CR1_CKD_1 << STM_TIM234_CR1_CKD) |
                                (0 << STM_TIM234_CR1_ARPE) |
                                (STM_TIM234_CR1_CMS_EDGE << STM_TIM234_CR1_CMS) |
                                (0 << STM_TIM234_CR1_DIR) |
@@ -127,12 +142,12 @@ ao_beep(uint8_t beep)
                                (1 << STM_TIM234_CR1_CEN));
 
                /* Update the values */
-               stm_tim3.egr = (1 << STM_TIM234_EGR_UG);
+               stm_beeper.egr = (1 << STM_TIM234_EGR_UG);
        }
 }
 
 void
-ao_beep_for(uint8_t beep, uint16_t ticks) 
+ao_beep_for(uint8_t beep, uint16_t ticks)
 {
        ao_beep(beep);
        ao_delay(ticks);
@@ -142,24 +157,9 @@ ao_beep_for(uint8_t beep, uint16_t ticks)
 void
 ao_beep_init(void)
 {
-#if BEEPER_CHANNEL == 1
-
-       /* Our beeper is on PC6, which is hooked to TIM3_CH1.
-        */
-       stm_rcc.ahbenr |= (1 << STM_RCC_AHBENR_GPIOCEN);
-
-       stm_afr_set(&stm_gpioc, 6, STM_AFR_AF2);
-#endif
-#if BEEPER_CHANNEL == 4
-
-       /* Our beeper is on PB1, which is hooked to TIM3_CH4.
-        */
-       stm_rcc.ahbenr |= (1 << STM_RCC_AHBENR_GPIOBEN);
-
-       stm_afr_set(&stm_gpiob, 1, STM_AFR_AF2);
-#endif
+       ao_enable_port(BEEPER_PORT);
+       stm_afr_set(BEEPER_PORT, BEEPER_PIN, BEEPER_AFR);
 
        /* Leave the timer off until requested */
-       
-       stm_rcc.apb1enr &= ~(1 << STM_RCC_APB1ENR_TIM3EN);
+       stm_rcc.apb1enr &= ~(1 << RCC_BEEPER);
 }
index 1da817e7a0db36267524bbf2b6dbf33cf80c4bb3..0109ec815525b2acdf3c6abe36cf5c86822794e6 100644 (file)
@@ -241,15 +241,14 @@ stm_gpio_get_all(struct stm_gpio *gpio) {
  * ao_enable_gpio macro will expand into a huge pile of code
  * as the compiler won't do correct constant folding and
  * dead-code elimination
+ */
 
- extern struct stm_gpio stm_gpioa;
- extern struct stm_gpio stm_gpiob;
- extern struct stm_gpio stm_gpioc;
- extern struct stm_gpio stm_gpiod;
- extern struct stm_gpio stm_gpioe;
- extern struct stm_gpio stm_gpioh;
-
-*/
+extern struct stm_gpio stm_gpioa;
+extern struct stm_gpio stm_gpiob;
+extern struct stm_gpio stm_gpioc;
+extern struct stm_gpio stm_gpiod;
+extern struct stm_gpio stm_gpioe;
+extern struct stm_gpio stm_gpioh;
 
 #define stm_gpioh  (*((struct stm_gpio *) 0x40021400))
 #define stm_gpioe  (*((struct stm_gpio *) 0x40021000))
index 4f27bad69a15b988e0a9d4139ac362431c9abdf2..cb0ec838e3bb90c9244297bd0d0e5b559a523967 100644 (file)
@@ -74,6 +74,9 @@
 #define HAS_BEEP               1
 #define HAS_BATTERY_REPORT     1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
+#define BEEPER_PORT            (&stm_gpiob)
+#define BEEPER_PIN             1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
 #define HAS_APRS               1
index ef533b3640496f48f6a5570daae434395d9ca633..c15e06bf1e4adf70167cf06315b09443f443d1c9 100644 (file)
 #define HAS_FLIGHT             0
 #define HAS_USB                        1
 #define HAS_BEEP               0
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_GPS                        0
 #define HAS_SERIAL_1           0
 #define HAS_ADC                        1
index d36d9d824d3c54589bc9eff801be7a9c237c04fd..15b158effc9ce12f21aac2d2a357a78f39b2a712 100644 (file)
@@ -27,6 +27,7 @@
 #define HAS_USB                        1
 #define HAS_BEEP               1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
 #define HAS_GPS                        0
 #define HAS_SERIAL_1           0
 #define HAS_ADC                        1
index 469e9937b89d9214631e5393abde407b6bf734b1..01faace2dfad944deff3825f8a5a9fc546c9ad69 100644 (file)
@@ -27,6 +27,7 @@
 #define HAS_USB                        1
 #define HAS_BEEP               1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
 #define HAS_GPS                        0
 #define HAS_SERIAL_1           0
 #define HAS_ADC                        1
index bc325e069523db073319a677d41b6fa7c9349f53..f3850ebd199c231d3b375988dd706ac0ab0955e1 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_RADIO              1
 #define HAS_RADIO_RATE         1
 #define HAS_TELEMETRY          0
index f0da4fe448a9625d79d37ed54dfbef585630eea3..3d06a647246d4f6523195d94c447fadeede5687a 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_RADIO              1
 #define HAS_RADIO_RATE         1
 #define HAS_TELEMETRY          0
index 6023739cb182f7d5e38ad5b5e726cb1e967bd5d9..c806268f7964991429d72f8204dc691f66c4e1a5 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_RADIO              1
 #define HAS_RADIO_RATE         1
 #define HAS_TELEMETRY          0
index ea709c1dbb60613700f2043c43cb06d3c2837182..e06633145fe7a1dc097c5d4e4d13a3bc6d2749c5 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_RADIO              1
 #define HAS_RADIO_RATE         1
 #define HAS_TELEMETRY          0
index 1941e03d7468c2aa9ea5f032be97ea2ba3c9f5b9..3ef88c7476a93ae742e790fc137a855a4ed2cebf 100644 (file)
@@ -51,6 +51,9 @@
 #define HAS_USB                        1
 #define HAS_BEEP               1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
+#define BEEPER_PORT            (&stm_gpiob)
+#define BEEPER_PIN             1
 #define HAS_RADIO              1
 #define HAS_RADIO_RATE         1
 #define HAS_TELEMETRY          0
index 64535c30b1714f6bef23a79d893cea790695ef15..0208fafa37cae69916683e5326bff7ad0c14f0e7 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
index 354da6a46210c07cfbb9eb28bea68858961977e5..a154225ec77d68bb907a96fef8fd456c3e5d46d8 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
index 46207884cdead83ea566e06466bb14647154b5ce..ba302c7409a2683c27bee0db87ce4ec36b1e2ebb 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
index ddcd0eb9a98a8e47b1ecff3438d6c7e2cfcfd34b..ce22390785a1c03a8097de26a422cc3e252cfa67 100644 (file)
 #define USE_STORAGE_CONFIG     0
 #define HAS_USB                        1
 #define HAS_BEEP               1
+#define BEEPER_TIMER           3
+#define BEEPER_CHANNEL         1
+#define BEEPER_PORT            (&stm_gpioc)
+#define BEEPER_PIN             6
 #define HAS_BATTERY_REPORT     1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
index 47f6dd2ad86fd420a202041fbb121af437249f17..e8c97ff4270461a4c3a7299202b47663250828a0 100644 (file)
@@ -74,6 +74,9 @@
 #define HAS_BEEP               1
 #define HAS_BATTERY_REPORT     1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
+#define BEEPER_PORT            (&stm_gpiob)
+#define BEEPER_PIN             1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
 #define HAS_APRS               1
index a8043bba4a88be373be9f95d44f05a7014441671..f4ccc9f3a93b7abf342586eefa2a3c79fe30219f 100644 (file)
@@ -74,6 +74,9 @@
 #define HAS_BEEP               1
 #define HAS_BATTERY_REPORT     1
 #define BEEPER_CHANNEL         4
+#define BEEPER_TIMER           3
+#define BEEPER_PORT            (&stm_gpiob)
+#define BEEPER_PIN             1
 #define HAS_RADIO              1
 #define HAS_TELEMETRY          1
 #define HAS_APRS               1
index 546d91e04870e5af7fc56f5290891e3b512eb0a2..d91b1d21fcf8d04374fc4efe3029b3a72f134c20 100644 (file)
@@ -74,9 +74,9 @@
 #define AO_RECOVERY_VALUE      0
 #define AO_RECOVERY_MODE       AO_EXTI_MODE_PULL_UP
 
-/* Beeper is on Tim1 CH3 */
+/* Beeper is on Tim3 CH4 */
 #define BEEPER_CHANNEL         4
-#define BEEPER_TIMER           2
+#define BEEPER_TIMER           3
 #define BEEPER_PORT            (&stm_gpioa)
 #define BEEPER_PIN             3