mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Tuning in ADC
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
|
||||
// These control the period's of time used for the PWM
|
||||
const uint16_t powerPWM = 255;
|
||||
const uint8_t holdoffTicks = 14;
|
||||
const uint8_t tempMeasureTicks = 10;
|
||||
const uint8_t holdoffTicks = 3; // This is the tick delay
|
||||
const uint8_t tempMeasureTicks = 4;
|
||||
|
||||
uint16_t totalPWM = 255; // Total length of the cycle's ticks
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ void switchToFastPWM(void) {
|
||||
|
||||
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, 11);
|
||||
|
||||
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void switchToSlowPWM(void) {
|
||||
|
||||
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
|
||||
|
||||
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 40);
|
||||
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 22);
|
||||
|
||||
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void setup_adc(void) {
|
||||
ADC_Reset();
|
||||
ADC_Init(&adc_cfg);
|
||||
adc_fifo_cfg.dmaEn = DISABLE;
|
||||
adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_8;
|
||||
adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_4;
|
||||
ADC_FIFO_Cfg(&adc_fifo_cfg);
|
||||
ADC_MIC_Bias_Disable();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user