Drop HAL_timer_set_count
This commit is contained in:
parent
a823b801b8
commit
a810e585db
|
@ -149,7 +149,6 @@ extern "C" {
|
|||
#define _CAT(a, ...) a ## __VA_ARGS__
|
||||
#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
|
||||
#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
|
||||
#define HAL_timer_set_count(timer, count) (_CAT(TIMER_COUNTER_, timer) = count)
|
||||
#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
|
||||
|
||||
#define HAL_timer_isr_prologue(timer_num)
|
||||
|
|
|
@ -101,11 +101,6 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
|||
return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC;
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV = count;
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV;
|
||||
|
|
|
@ -110,13 +110,6 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
|
||||
switch (timer_num) {
|
||||
case 0: LPC_TIM0->TC = count; break;
|
||||
case 1: LPC_TIM1->TC = count; break;
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: return LPC_TIM0->TC;
|
||||
|
|
|
@ -83,7 +83,6 @@ typedef uint16_t hal_timer_t;
|
|||
#define DISABLE_TEMPERATURE_INTERRUPT() timer_disable_irq(TEMP_TIMER_DEV, TEMP_TIMER_CHAN)
|
||||
|
||||
#define HAL_timer_get_count(timer_num) timer_get_count(TIMER_DEV(timer_num))
|
||||
#define HAL_timer_set_count(timer_num, count) timer_set_count(TIMER_DEV(timer_num), (uint16)count)
|
||||
|
||||
|
||||
#define HAL_ENABLE_ISRs() do { if (thermalManager.in_temp_isr)DISABLE_TEMPERATURE_INTERRUPT(); else ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
|
||||
|
|
|
@ -121,10 +121,6 @@ void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) {
|
|||
__HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, compare);
|
||||
}
|
||||
|
||||
void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count) {
|
||||
__HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, count);
|
||||
}
|
||||
|
||||
void HAL_timer_enable_interrupt(const uint8_t timer_num) {
|
||||
HAL_NVIC_EnableIRQ(timerConfig[timer_num].IRQ_Id);
|
||||
}
|
||||
|
|
|
@ -95,11 +95,6 @@ void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare);
|
|||
hal_timer_t HAL_timer_get_compare(const uint8_t timer_num);
|
||||
uint32_t HAL_timer_get_count(const uint8_t timer_num);
|
||||
|
||||
void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count); // New
|
||||
/*FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
|
||||
// To do ??
|
||||
}*/
|
||||
|
||||
void HAL_timer_isr_prologue(const uint8_t timer_num);
|
||||
|
||||
#endif // _HAL_TIMERS_STM32F7_H
|
||||
|
|
|
@ -95,13 +95,6 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
|
||||
switch (timer_num) {
|
||||
case 0: FTM0_CNT = count;
|
||||
case 1: FTM1_CNT = count;
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: return FTM0_CNT;
|
||||
|
|
Loading…
Reference in a new issue