X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstm%2Fao_beep_stm.c;h=4761fbfc87d5fbf8f05bc0a48364a0a47e8e15eb;hb=56a7cbbf51f5c9ebbfe17d1cc30ed807572af3cc;hp=8c0c0ee33ea889f5006995eca28a200a046daa29;hpb=1dcfbb05531767e67df45c2799a2fe533834fb71;p=fw%2Faltos diff --git a/src/stm/ao_beep_stm.c b/src/stm/ao_beep_stm.c index 8c0c0ee3..4761fbfc 100644 --- a/src/stm/ao_beep_stm.c +++ b/src/stm/ao_beep_stm.c @@ -26,22 +26,13 @@ ao_beep(uint8_t beep) } else { stm_rcc.apb1enr |= (1 << STM_RCC_APB1ENR_TIM3EN); - stm_tim3.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) | - (0 << STM_TIM234_CR1_OPM) | - (0 << STM_TIM234_CR1_URS) | - (0 << STM_TIM234_CR1_UDIS) | - (0 << STM_TIM234_CR1_CEN)); - stm_tim3.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 = STM_APB1 / 750000; + stm_tim3.psc = AO_TIM23467_CLK / 750000; /* 1. Select the counter clock (internal, external, prescaler). * @@ -102,6 +93,9 @@ ao_beep(uint8_t beep) (0 << STM_TIM234_CR1_URS) | (0 << STM_TIM234_CR1_UDIS) | (1 << STM_TIM234_CR1_CEN)); + + /* Update the values */ + stm_tim3.egr = (1 << STM_TIM234_EGR_UG); } }