You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
toaster-oven-bluepill/Core/Src/app_heater.c

23 lines
352 B

/**
* TODO file description
*/
#include "main.h"
#include "app_heater.h"
#include "tim.h"
void app_heater_init()
{
HAL_TIM_Base_Start(&htim3);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
}
void app_heater_set(bool active)
{
if (active) {
TIM3->CCR1 = TIM3->ARR / 2; // testing - 50%
} else {
TIM3->CCR1 = 0;
}
}