diff --git a/source/Core/BSP/Magic/IRQ.cpp b/source/Core/BSP/Magic/IRQ.cpp index b478650b..756b112c 100644 --- a/source/Core/BSP/Magic/IRQ.cpp +++ b/source/Core/BSP/Magic/IRQ.cpp @@ -100,7 +100,7 @@ void timer0_irq_callback(struct device *dev, void *args, uint32_t size, uint32_t } else if (state == TIMER_EVENT_COMP1) { // MSG((char *)"timer event comp1! \r\n"); // Used to turn tip off at set point in cycle - + PWM_Channel_Disable(PWM_Channel); } else if (state == TIMER_EVENT_COMP2) { start_adc_misc(); // This occurs at timer rollover, so if we want to turn on the output PWM; we do so @@ -117,9 +117,11 @@ void timer0_irq_callback(struct device *dev, void *args, uint32_t size, uint32_t if (pendingPWM > 0) { TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_1, pendingPWM - 1); // Turn on output + PWM_Channel_Enable(PWM_Channel); } else { TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_1, 0); // Leave output off + PWM_Channel_Disable(PWM_Channel); } } // unblock the PID controller thread diff --git a/source/Core/BSP/Magic/Setup.cpp b/source/Core/BSP/Magic/Setup.cpp index 6221eb63..c2e6c34b 100644 --- a/source/Core/BSP/Magic/Setup.cpp +++ b/source/Core/BSP/Magic/Setup.cpp @@ -49,7 +49,7 @@ void setup_pwm(void) { BL_Err_Type err = PWM_Channel_Init(&cfg); uint32_t pwm_clk = peripheral_clock_get(PERIPHERAL_CLOCK_PWM); MSG((char *)"PWM Setup returns %d %d\r\n", err, pwm_clk); - PWM_Channel_Enable(PWM_Channel); + PWM_Channel_Disable(PWM_Channel); } void setup_adc(void) { MSG((char *)"Setting up ADC\r\n"); diff --git a/source/Makefile b/source/Makefile index 0681ad36..9f3f358e 100644 --- a/source/Makefile +++ b/source/Makefile @@ -270,6 +270,7 @@ CPUFLAGS= -march=rv32imafc \ -mabi=ilp32f \ -mcmodel=medany -fsigned-char -fno-builtin -nostartfiles \ -DportasmHANDLE_INTERRUPT=FreeRTOS_Interrupt_Handler -DARCH_RISCV -D__RISCV_FEATURE_MVE=0 -DportUSING_MPU_WRAPPERS=0 +# -DBFLB_USE_ROM_DRIVER=1 DEV_LDFLAGS=-nostartfiles --specs=patch.specs -DDEBUG DEV_AFLAGS= DEV_GLOBAL_DEFS=