1
0
forked from me/IronOS

Display running

This commit is contained in:
Ben V. Brown
2022-04-13 18:51:05 +10:00
parent dda595a2e8
commit d4e27a5b9b
4 changed files with 38 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ extern "C" {
#include "Settings.h"
#include "TipThermoModel.h"
#include "Translation.h"
#include "bflb_platform.h"
#include "cmsis_os.h"
#include "configuration.h"
#include "main.hpp"
@@ -799,8 +800,16 @@ void showDebugMenu(void) {
}
void showWarnings() {
MSG((char *)"showWarningsshowWarnings\r\n");
return;
// Display alert if settings were reset
if (settingsWereReset) {
MSG((char *)"WarnUser - %ld\r\n\r\n", (uint64_t)Tr);
MSG((char *)"WarnUser - %ld\r\n\r\n", (uint64_t)Tr);
MSG((char *)"WarnUser - %ld\r\n\r\n", (uint64_t)Tr);
MSG((char *)"WarnUser - %ld\r\n\r\n", (uint64_t)Tr);
MSG((char *)"WarnUser - %ld\r\n\r\n", (uint64_t)Tr);
warnUser(translatedString(Tr->SettingsResetMessage), 10 * TICKS_SECOND);
}
#ifndef NO_WARN_MISSING
@@ -808,6 +817,7 @@ void showWarnings() {
// In this case though, we dont want to nag the user _too_ much
// So only show first 2 times
while (DetectedAccelerometerVersion == AccelType::Scanning) {
MSG((char *)"Accel Detect");
osDelay(5);
}
// Display alert if accelerometer is not detected
@@ -837,10 +847,14 @@ uint8_t disconnectedTipF[sizeof(disconnectedTip)];
/* StartGUITask function */
void startGUITask(void const *argument) {
(void)argument;
MSG((char *)"startGUITask\r\n");
prepareTranslations();
MSG((char *)"OLEDInit\r\n");
OLED::initialize(); // start up the LCD
MSG((char *)"setBrightness\r\n");
OLED::setBrightness(getSettingValue(SettingsOptions::OLEDBrightness));
MSG((char *)"setInverseDisplay\r\n");
OLED::setInverseDisplay(getSettingValue(SettingsOptions::OLEDInversion));
uint8_t tempWarningState = 0;
@@ -848,6 +862,8 @@ void startGUITask(void const *argument) {
bool tempOnDisplay = false;
bool tipDisconnectedDisplay = false;
bool showExitMenuTransition = false;
MSG((char *)"flip\r\n");
{
// Generate the flipped screen into ram for later use
// flipped is generated by flipping each row
@@ -859,18 +875,24 @@ void startGUITask(void const *argument) {
}
}
}
MSG((char *)"tipTemp\r\n");
getTipRawTemp(1); // reset filter
MSG((char *)"setRotation\r\n");
OLED::setRotation(getSettingValue(SettingsOptions::OrientationMode) & 1);
MSG((char *)"Bootlogo\r\n");
BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR);
// BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR);
MSG((char *)"showWarnings\r\n");
showWarnings();
MSG((char *)"AutoStartMode\r\n");
if (getSettingValue(SettingsOptions::AutoStartMode)) {
// jump directly to the autostart mode
gui_solderingMode(getSettingValue(SettingsOptions::AutoStartMode) - 1);
buttonLockout = true;
}
MSG((char *)"GUI Thread Start\r\n");
for (;;) {
ButtonState buttons = getButtonState();

View File

@@ -16,6 +16,7 @@
#include "SC7A20.hpp"
#include "Settings.h"
#include "TipThermoModel.h"
#include "bflb_platform.h"
#include "cmsis_os.h"
#include "configuration.h"
#include "history.hpp"
@@ -117,6 +118,7 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation
}
}
void startMOVTask(void const *argument __unused) {
MSG((char *)"startMOVTask\r\n");
osDelay(TICKS_100MS / 5); // This is here as the BMA doesnt start up instantly and can wedge the I2C bus if probed too fast after boot
detectAccelerometerVersion();
osDelay(TICKS_100MS / 2); // wait ~50ms for setup of accel to finalise

View File

@@ -9,11 +9,13 @@
#include "FreeRTOS.h"
#include "Settings.h"
#include "TipThermoModel.h"
#include "bflb_platform.h"
#include "cmsis_os.h"
#include "history.hpp"
#include "main.hpp"
#include "power.hpp"
#include "task.h"
static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s
static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms
TaskHandle_t pidTaskNotification = NULL;
@@ -28,6 +30,7 @@ static int32_t getX10WattageLimits();
/* StartPIDTask function */
void startPIDTask(void const *argument __unused) {
MSG((char *)"startPIDTask\r\n");
/*
* We take the current tip temperature & evaluate the next step for the tip
* control PWM.

View File

@@ -10,6 +10,7 @@
#include "QC3.h"
#include "Settings.h"
#include "USBPD.h"
#include "bflb_platform.h"
#include "cmsis_os.h"
#include "configuration.h"
#include "main.hpp"
@@ -19,11 +20,12 @@
// Small worker thread to handle power (PD + QC) related steps
void startPOWTask(void const *argument __unused) {
// MSG((char *)"startPOWTask\r\n");
// Init any other misc sensors
postRToSInit();
// You have to run this once we are willing to answer PD messages
// Setting up too early can mean that we miss the ~20ms window to respond on some chargers
// MSG((char *)"POW_PD\r\n");
#if POW_PD
USBPowerDelivery::start();
// Crank the handle at boot until we are stable and waiting for IRQ
@@ -40,20 +42,24 @@ void startPOWTask(void const *argument __unused) {
* Then Good CRC is set while reading it out (racing on I2C read)
* Then we would sleep as nothing to do, but 100ms> 20ms power supply typical timeout
*/
// MSG((char *)"getFUS302IRQLow\r\n");
if (!getFUS302IRQLow()) {
res = xTaskNotifyWait(0x0, 0xFFFFFF, NULL, TICKS_100MS);
}
#if POW_PD
// MSG((char *)"IRQ\r\n");
if (res != pdFALSE || getFUS302IRQLow()) {
USBPowerDelivery::IRQOccured();
}
// MSG((char *)"Step\r\n");
USBPowerDelivery::step();
// MSG((char *)"PPS\r\n");
USBPowerDelivery::PPSTimerCallback();
#else
(void)res;
#endif
// MSG((char *)"power_check\r\n");
power_check();
}
}