1
0
forked from me/IronOS

Retiming all the PWM's

This commit is contained in:
Ben V. Brown
2021-09-14 21:48:37 +10:00
parent 159ae7a8e2
commit a57449ed0f
8 changed files with 71 additions and 102 deletions

View File

@@ -12,7 +12,7 @@
#include "history.hpp"
#include <string.h>
#define ADC_NORM_SAMPLES 16
#define ADC_FILTER_LEN 32
#define ADC_FILTER_LEN 4
uint16_t ADCReadings[ADC_NORM_SAMPLES]; // room for 32 lots of the pair of readings
// Functions
@@ -264,10 +264,10 @@ void setup_timers() {
/* initialize TIMER init parameter struct */
timer_struct_para_init(&timer_initpara);
/* TIMER1 configuration */
timer_initpara.prescaler = 5000;
timer_initpara.prescaler = 30000;
timer_initpara.alignedmode = TIMER_COUNTER_EDGE;
timer_initpara.counterdirection = TIMER_COUNTER_UP;
timer_initpara.period = powerPWM + tempMeasureTicks;
timer_initpara.period = powerPWM + tempMeasureTicks + holdoffTicks;
timer_initpara.clockdivision = TIMER_CKDIV_DIV4;
timer_initpara.repetitioncounter = 0;
timer_init(TIMER1, &timer_initpara);