mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #173 from bcostm/master
[NUCLEO_xxx] Fix issue with ticker + add volatilepull/176/head
commit
94a1bdc84b
|
@ -37,8 +37,8 @@
|
|||
|
||||
static int us_ticker_inited = 0;
|
||||
static volatile uint32_t SlaveCounter = 0;
|
||||
static uint32_t oc_int_part = 0;
|
||||
static uint16_t oc_rem_part = 0;
|
||||
static volatile uint32_t oc_int_part = 0;
|
||||
static volatile uint16_t oc_rem_part = 0;
|
||||
|
||||
void set_compare(uint16_t count) {
|
||||
// Set new output compare value
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
|
||||
static int us_ticker_inited = 0;
|
||||
static volatile uint32_t SlaveCounter = 0;
|
||||
static uint32_t oc_int_part = 0;
|
||||
static uint16_t oc_rem_part = 0;
|
||||
static volatile uint32_t oc_int_part = 0;
|
||||
static volatile uint16_t oc_rem_part = 0;
|
||||
|
||||
void set_compare(uint16_t count) {
|
||||
// Set new output compare value
|
||||
|
|
|
@ -40,8 +40,8 @@ static TIM_HandleTypeDef TimMasterHandle;
|
|||
|
||||
static int us_ticker_inited = 0;
|
||||
static volatile uint32_t SlaveCounter = 0;
|
||||
static uint32_t oc_int_part = 0;
|
||||
static uint16_t oc_rem_part = 0;
|
||||
static volatile uint32_t oc_int_part = 0;
|
||||
static volatile uint16_t oc_rem_part = 0;
|
||||
|
||||
void set_compare(uint16_t count) {
|
||||
// Set new output compare value
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
|
||||
static int us_ticker_inited = 0;
|
||||
static volatile uint32_t SlaveCounter = 0;
|
||||
static uint32_t oc_int_part = 0;
|
||||
static uint16_t oc_rem_part = 0;
|
||||
static volatile uint32_t oc_int_part = 0;
|
||||
static volatile uint16_t oc_rem_part = 0;
|
||||
|
||||
void set_compare(uint16_t count) {
|
||||
// Set new output compare value
|
||||
|
@ -58,8 +58,6 @@ static void tim_update_oc_irq_handler(void) {
|
|||
// Output compare interrupt: used by interrupt system
|
||||
if (TIM_GetITStatus(TIM_MST, TIM_IT_CC1) == SET) {
|
||||
TIM_ClearITPendingBit(TIM_MST, TIM_IT_CC1);
|
||||
}
|
||||
|
||||
if (oc_rem_part > 0) {
|
||||
set_compare(oc_rem_part); // Finish the remaining time left
|
||||
oc_rem_part = 0;
|
||||
|
@ -75,6 +73,7 @@ static void tim_update_oc_irq_handler(void) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void us_ticker_init(void) {
|
||||
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
|
||||
|
|
Loading…
Reference in New Issue