full profile support

This commit is contained in:
Laura Klünder
2023-04-23 23:48:24 +02:00
parent 448e5c8ad1
commit cb2e8af700
15 changed files with 334 additions and 87 deletions

View File

@@ -436,7 +436,7 @@ void setBuzzer(bool on) {
htim3.Instance->PSC = 1; // revert back out of hearing range
}
}
void setStatusLED(const enum StatusLED state) {
void setStatusLED(const enum StatusLED state, bool buzzer) {
static enum StatusLED lastState = LED_UNKNOWN;
static TickType_t buzzerEnd = 0;
@@ -455,17 +455,19 @@ void setStatusLED(const enum StatusLED state) {
} break;
case LED_HOT:
ws2812.led_set_color(0, 0xFF, 0, 0); // red
// We have hit the right temp, run buzzer for a short period
buzzerEnd = xTaskGetTickCount() + TICKS_SECOND / 3;
break;
case LED_COOLING_STILL_HOT:
ws2812.led_set_color(0, 0xFF, 0x8C, 0x00); // Orange
break;
}
if (buzzer) {
// Buzzer requested
buzzerEnd = xTaskGetTickCount() + TICKS_SECOND / 3;
}
ws2812.led_update();
lastState = state;
}
if (state == LED_HOT && xTaskGetTickCount() < buzzerEnd) {
if (xTaskGetTickCount() < buzzerEnd) {
setBuzzer(true);
} else {
setBuzzer(false);

View File

@@ -155,7 +155,7 @@
#define ACCEL_SC7
#define ACCEL_MSA
#define PROFILE_MODE
#define PROFILE_SUPPORT
#define POW_PD 1
#define TEMP_NTC