mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Compare commits
1 Commits
v2.22-rc3
...
double-pin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07893daec7 |
@@ -112,8 +112,8 @@ void timer0_comp1_callback(void) { PWM_Channel_Disable(PWM_Channel); } // Trigge
|
|||||||
|
|
||||||
void switchToFastPWM(void) {
|
void switchToFastPWM(void) {
|
||||||
inFastPWMMode = true;
|
inFastPWMMode = true;
|
||||||
holdoffTicks = 10;
|
holdoffTicks = 20;
|
||||||
tempMeasureTicks = 10;
|
tempMeasureTicks = 20;
|
||||||
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
|
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
|
||||||
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
|
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ void switchToFastPWM(void) {
|
|||||||
|
|
||||||
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
|
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
|
||||||
|
|
||||||
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 10);
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 6);
|
||||||
|
|
||||||
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
||||||
}
|
}
|
||||||
@@ -131,8 +131,8 @@ void switchToFastPWM(void) {
|
|||||||
void switchToSlowPWM(void) {
|
void switchToSlowPWM(void) {
|
||||||
// 5Hz
|
// 5Hz
|
||||||
inFastPWMMode = false;
|
inFastPWMMode = false;
|
||||||
holdoffTicks = 5;
|
holdoffTicks = 10;
|
||||||
tempMeasureTicks = 5;
|
tempMeasureTicks = 10;
|
||||||
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
|
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
|
||||||
|
|
||||||
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
|
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
|
||||||
@@ -143,7 +143,7 @@ void switchToSlowPWM(void) {
|
|||||||
|
|
||||||
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
|
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
|
||||||
|
|
||||||
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 20);
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 12);
|
||||||
|
|
||||||
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user