1
0
forked from me/IronOS

Pull out more QC hooks

This commit is contained in:
Ben V. Brown
2020-05-30 12:05:11 +10:00
parent 2bcebd473e
commit 5bb85a4a32
6 changed files with 739 additions and 782 deletions

View File

@@ -1,8 +1,8 @@
#include "Defines.h"
#include "stdint.h"
#include "UnitSettings.h"
#include "BSP_QC.h"
#include "BSP_Flash.h" #include "BSP_Flash.h"
#include "BSP_QC.h"
#include "Defines.h"
#include "UnitSettings.h"
#include "stdint.h"
/* /*
* BSP.h -- Board Support * BSP.h -- Board Support
* *

View File

@@ -32,6 +32,9 @@ void QC_Post_Probe_En();
// Check if DM was pulled down // Check if DM was pulled down
// 1=Pulled down, 0 == pulled high // 1=Pulled down, 0 == pulled high
uint8_t QC_DM_PulledDown(); uint8_t QC_DM_PulledDown();
// Re-sync if required
void QC_resync();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -6,6 +6,8 @@
*/ */
#include "BSP.h" #include "BSP.h"
#include "Pins.h" #include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "stm32f1xx_hal.h" #include "stm32f1xx_hal.h"
void QC_DPlusZero_Six() { void QC_DPlusZero_Six() {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); // pull down D+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); // pull down D+
@@ -63,3 +65,10 @@ void QC_Post_Probe_En() {
} }
uint8_t QC_DM_PulledDown() { return HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO_PIN_RESET ? 1 : 0; } uint8_t QC_DM_PulledDown() { return HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO_PIN_RESET ? 1 : 0; }
void QC_resync() {
#ifdef MODEL_TS80
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
systemSettings.voltageDiv); // Run the QC seek again if we have drifted too much
#endif
}

View File

@@ -0,0 +1,23 @@
#include "BSP.h"
#include "FreeRTOS.h"
#include "QC3.h"
#include "Settings.h"
#include "cmsis_os.h"
#include "main.hpp"
#include "power.hpp"
#include "stdlib.h"
#include "task.h"
void postRToSInit() {
#ifdef MODEL_TS80
startQC(systemSettings.voltageDiv);
while (pidTaskNotification == 0) osDelay(30); // Wait for PID to start
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
systemSettings.voltageDiv); // this will move the QC output to the preferred voltage to start with
#else
while (pidTaskNotification == 0) osDelay(30); // Wait for PID to start
osDelay(200); // wait for accelerometer to stabilize
#endif
}

View File

@@ -9,19 +9,20 @@ extern "C" {
} }
#include <MMA8652FC.hpp> #include <MMA8652FC.hpp>
#include <gui.hpp> #include <gui.hpp>
#include <main.hpp>
#include "LIS2DH12.hpp"
#include <history.hpp> #include <history.hpp>
#include <main.hpp>
#include <power.hpp> #include <power.hpp>
#include "../../configuration.h"
#include "Buttons.hpp"
#include "LIS2DH12.hpp"
#include "Settings.h" #include "Settings.h"
#include "TipThermoModel.h"
#include "Translation.h" #include "Translation.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "TipThermoModel.h"
#include "unit.h" #include "unit.h"
#include "../../configuration.h"
#include "Buttons.hpp"
extern uint8_t PCBVersion; extern uint8_t PCBVersion;
// File local variables // File local variables
extern uint32_t currentTempTargetDegC; extern uint32_t currentTempTargetDegC;
@@ -126,15 +127,12 @@ static void gui_drawBatteryIcon() {
// User is on a lithium battery // User is on a lithium battery
// we need to calculate which of the 10 levels they are on // we need to calculate which of the 10 levels they are on
uint8_t cellCount = systemSettings.cutoutSetting + 2; uint8_t cellCount = systemSettings.cutoutSetting + 2;
uint32_t cellV = getInputVoltageX10(systemSettings.voltageDiv, 0) uint32_t cellV = getInputVoltageX10(systemSettings.voltageDiv, 0) / cellCount;
/ cellCount;
// Should give us approx cell voltage X10 // Should give us approx cell voltage X10
// Range is 42 -> 33 = 9 steps therefore we will use battery 1-10 // Range is 42 -> 33 = 9 steps therefore we will use battery 1-10
if (cellV < 33) if (cellV < 33) cellV = 33;
cellV = 33;
cellV -= 33; // Should leave us a number of 0-9 cellV -= 33; // Should leave us a number of 0-9
if (cellV > 9) if (cellV > 9) cellV = 9;
cellV = 9;
OLED::drawBattery(cellV + 1); OLED::drawBattery(cellV + 1);
} else } else
OLED::drawSymbol(15); // Draw the DC Logo OLED::drawSymbol(15); // Draw the DC Logo
@@ -169,8 +167,7 @@ static void gui_solderingTempAdjust() {
OLED::clearScreen(); OLED::clearScreen();
OLED::setFont(0); OLED::setFont(0);
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
if (buttons) if (buttons) lastChange = xTaskGetTickCount();
lastChange = xTaskGetTickCount();
switch (buttons) { switch (buttons) {
case BUTTON_NONE: case BUTTON_NONE:
// stay // stay
@@ -180,14 +177,11 @@ static void gui_solderingTempAdjust() {
return; return;
break; break;
case BUTTON_B_LONG: case BUTTON_B_LONG:
if (xTaskGetTickCount() - autoRepeatTimer if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration > PRESS_ACCEL_INTERVAL_MAX) {
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
if (systemSettings.ReverseButtonTempChangeEnabled) { if (systemSettings.ReverseButtonTempChangeEnabled) {
systemSettings.SolderingTemp += systemSettings.SolderingTemp += systemSettings.TempChangeLongStep;
systemSettings.TempChangeLongStep;
} else } else
systemSettings.SolderingTemp -= systemSettings.SolderingTemp -= systemSettings.TempChangeLongStep;
systemSettings.TempChangeLongStep;
autoRepeatTimer = xTaskGetTickCount(); autoRepeatTimer = xTaskGetTickCount();
autoRepeatAcceleration += PRESS_ACCEL_STEP; autoRepeatAcceleration += PRESS_ACCEL_STEP;
@@ -195,73 +189,54 @@ static void gui_solderingTempAdjust() {
break; break;
case BUTTON_B_SHORT: case BUTTON_B_SHORT:
if (systemSettings.ReverseButtonTempChangeEnabled) { if (systemSettings.ReverseButtonTempChangeEnabled) {
systemSettings.SolderingTemp += systemSettings.SolderingTemp += systemSettings.TempChangeShortStep;
systemSettings.TempChangeShortStep;
} else } else
systemSettings.SolderingTemp -= systemSettings.SolderingTemp -= systemSettings.TempChangeShortStep;
systemSettings.TempChangeShortStep;
break; break;
case BUTTON_F_LONG: case BUTTON_F_LONG:
if (xTaskGetTickCount() - autoRepeatTimer if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration > PRESS_ACCEL_INTERVAL_MAX) {
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
if (systemSettings.ReverseButtonTempChangeEnabled) { if (systemSettings.ReverseButtonTempChangeEnabled) {
systemSettings.SolderingTemp -= systemSettings.SolderingTemp -= systemSettings.TempChangeLongStep;
systemSettings.TempChangeLongStep;
} else } else
systemSettings.SolderingTemp += systemSettings.SolderingTemp += systemSettings.TempChangeLongStep;
systemSettings.TempChangeLongStep;
autoRepeatTimer = xTaskGetTickCount(); autoRepeatTimer = xTaskGetTickCount();
autoRepeatAcceleration += PRESS_ACCEL_STEP; autoRepeatAcceleration += PRESS_ACCEL_STEP;
} }
break; break;
case BUTTON_F_SHORT: case BUTTON_F_SHORT:
if (systemSettings.ReverseButtonTempChangeEnabled) { if (systemSettings.ReverseButtonTempChangeEnabled) {
systemSettings.SolderingTemp -= systemSettings.SolderingTemp -= systemSettings.TempChangeShortStep; // add 10
systemSettings.TempChangeShortStep; // add 10
} else } else
systemSettings.SolderingTemp += systemSettings.SolderingTemp += systemSettings.TempChangeShortStep; // add 10
systemSettings.TempChangeShortStep; // add 10
break; break;
default: default:
break; break;
} }
if ((PRESS_ACCEL_INTERVAL_MAX - autoRepeatAcceleration) if ((PRESS_ACCEL_INTERVAL_MAX - autoRepeatAcceleration) < PRESS_ACCEL_INTERVAL_MIN) {
< PRESS_ACCEL_INTERVAL_MIN) { autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX
- PRESS_ACCEL_INTERVAL_MIN;
} }
// constrain between 10-450 C // constrain between 10-450 C
#ifdef ENABLED_FAHRENHEIT_SUPPORT #ifdef ENABLED_FAHRENHEIT_SUPPORT
if (systemSettings.temperatureInF) { if (systemSettings.temperatureInF) {
if (systemSettings.SolderingTemp > 850) if (systemSettings.SolderingTemp > 850) systemSettings.SolderingTemp = 850;
systemSettings.SolderingTemp = 850; if (systemSettings.SolderingTemp < 60) systemSettings.SolderingTemp = 60;
if (systemSettings.SolderingTemp < 60) } else
systemSettings.SolderingTemp = 60;
}
else
#endif #endif
{ {
if (systemSettings.SolderingTemp > 450) if (systemSettings.SolderingTemp > 450) systemSettings.SolderingTemp = 450;
systemSettings.SolderingTemp = 450; if (systemSettings.SolderingTemp < 10) systemSettings.SolderingTemp = 10;
if (systemSettings.SolderingTemp < 10)
systemSettings.SolderingTemp = 10;
} }
if (xTaskGetTickCount() - lastChange > 200) if (xTaskGetTickCount() - lastChange > 200) return; // exit if user just doesn't press anything for a bit
return; // exit if user just doesn't press anything for a bit
#ifdef MODEL_TS80 #ifdef MODEL_TS80
if (!OLED::getRotation()) { if (!OLED::getRotation()) {
#else #else
if (OLED::getRotation()) { if (OLED::getRotation()) {
#endif #endif
OLED::print( OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolPlus : SymbolMinus);
systemSettings.ReverseButtonTempChangeEnabled ?
SymbolPlus : SymbolMinus);
} else { } else {
OLED::print( OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolMinus : SymbolPlus);
systemSettings.ReverseButtonTempChangeEnabled ?
SymbolMinus : SymbolPlus);
} }
OLED::print(SymbolSpace); OLED::print(SymbolSpace);
@@ -280,13 +255,9 @@ static void gui_solderingTempAdjust() {
#else #else
if (OLED::getRotation()) { if (OLED::getRotation()) {
#endif #endif
OLED::print( OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolMinus : SymbolPlus);
systemSettings.ReverseButtonTempChangeEnabled ?
SymbolMinus : SymbolPlus);
} else { } else {
OLED::print( OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolPlus : SymbolMinus);
systemSettings.ReverseButtonTempChangeEnabled ?
SymbolPlus : SymbolMinus);
} }
OLED::refresh(); OLED::refresh();
GUIDelay(); GUIDelay();
@@ -298,29 +269,18 @@ static int gui_SolderingSleepingMode(bool stayOff) {
for (;;) { for (;;) {
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
if (buttons) if (buttons) return 0;
return 0; if ((xTaskGetTickCount() > 100) && ((accelInit && (xTaskGetTickCount() - lastMovementTime < 100)) || (xTaskGetTickCount() - lastButtonTime < 100))) return 0; // user moved or pressed a button, go back to soldering
if ((xTaskGetTickCount() > 100)
&& ((accelInit && (xTaskGetTickCount() - lastMovementTime < 100))
|| (xTaskGetTickCount() - lastButtonTime < 100)))
return 0; // user moved or pressed a button, go back to soldering
#ifdef MODEL_TS100 #ifdef MODEL_TS100
if (checkVoltageForExit()) if (checkVoltageForExit()) return 1; // return non-zero on error
return 1; // return non-zero on error
#endif #endif
#ifdef ENABLED_FAHRENHEIT_SUPPORT #ifdef ENABLED_FAHRENHEIT_SUPPORT
if (systemSettings.temperatureInF) { if (systemSettings.temperatureInF) {
currentTempTargetDegC = stayOff ? 0 : TipThermoModel::convertFtoC( currentTempTargetDegC = stayOff ? 0 : TipThermoModel::convertFtoC(min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
min(systemSettings.SleepTemp,
systemSettings.SolderingTemp));
} else } else
#endif #endif
{ {
currentTempTargetDegC = currentTempTargetDegC = stayOff ? 0 : min(systemSettings.SleepTemp, systemSettings.SolderingTemp);
stayOff ?
0 :
min(systemSettings.SleepTemp,
systemSettings.SolderingTemp);
} }
// draw the lcd // draw the lcd
uint16_t tipTemp; uint16_t tipTemp;
@@ -368,8 +328,7 @@ static int gui_SolderingSleepingMode(bool stayOff) {
} }
if (systemSettings.ShutdownTime) // only allow shutdown exit if time > 0 if (systemSettings.ShutdownTime) // only allow shutdown exit if time > 0
if (lastMovementTime) if (lastMovementTime)
if (((uint32_t) (xTaskGetTickCount() - lastMovementTime)) if (((uint32_t)(xTaskGetTickCount() - lastMovementTime)) > (uint32_t)(systemSettings.ShutdownTime * 60 * 100)) {
> (uint32_t) (systemSettings.ShutdownTime * 60 * 100)) {
// shutdown // shutdown
currentTempTargetDegC = 0; currentTempTargetDegC = 0;
return 1; // we want to exit soldering mode return 1; // we want to exit soldering mode
@@ -385,9 +344,7 @@ static void display_countdown(int sleepThres) {
* Print seconds or minutes (if > 99 seconds) until sleep * Print seconds or minutes (if > 99 seconds) until sleep
* mode is triggered. * mode is triggered.
*/ */
int lastEventTime = int lastEventTime = lastButtonTime < lastMovementTime ? lastMovementTime : lastButtonTime;
lastButtonTime < lastMovementTime ?
lastMovementTime : lastButtonTime;
int downCount = sleepThres - xTaskGetTickCount() + lastEventTime; int downCount = sleepThres - xTaskGetTickCount() + lastEventTime;
if (downCount > 9900) { if (downCount > 9900) {
OLED::printNumber(downCount / 6000 + 1, 2); OLED::printNumber(downCount / 6000 + 1, 2);
@@ -426,7 +383,6 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
} }
} }
for (;;) { for (;;) {
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
switch (buttons) { switch (buttons) {
case BUTTON_NONE: case BUTTON_NONE:
@@ -442,8 +398,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
break; break;
case BUTTON_F_LONG: case BUTTON_F_LONG:
// if boost mode is enabled turn it on // if boost mode is enabled turn it on
if (systemSettings.boostModeEnabled) if (systemSettings.boostModeEnabled) boostModeOn = true;
boostModeOn = true;
break; break;
case BUTTON_F_SHORT: case BUTTON_F_SHORT:
case BUTTON_B_SHORT: { case BUTTON_B_SHORT: {
@@ -452,8 +407,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
if (oldTemp != systemSettings.SolderingTemp) { if (oldTemp != systemSettings.SolderingTemp) {
saveSettings(); // only save on change saveSettings(); // only save on change
} }
} } break;
break;
default: default:
break; break;
} }
@@ -524,8 +478,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
if (boostModeOn) { if (boostModeOn) {
#ifdef ENABLED_FAHRENHEIT_SUPPORT #ifdef ENABLED_FAHRENHEIT_SUPPORT
if (systemSettings.temperatureInF) if (systemSettings.temperatureInF)
currentTempTargetDegC = TipThermoModel::convertFtoC( currentTempTargetDegC = TipThermoModel::convertFtoC(systemSettings.BoostTemp);
systemSettings.BoostTemp);
else else
#endif #endif
{ {
@@ -534,8 +487,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
} else { } else {
#ifdef ENABLED_FAHRENHEIT_SUPPORT #ifdef ENABLED_FAHRENHEIT_SUPPORT
if (systemSettings.temperatureInF) if (systemSettings.temperatureInF)
currentTempTargetDegC = TipThermoModel::convertFtoC( currentTempTargetDegC = TipThermoModel::convertFtoC(systemSettings.SolderingTemp);
systemSettings.SolderingTemp);
else else
#endif #endif
{ {
@@ -559,8 +511,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
#endif #endif
if (systemSettings.sensitivity && systemSettings.SleepTime) if (systemSettings.sensitivity && systemSettings.SleepTime)
if (xTaskGetTickCount() - lastMovementTime > sleepThres if (xTaskGetTickCount() - lastMovementTime > sleepThres && xTaskGetTickCount() - lastButtonTime > sleepThres) {
&& xTaskGetTickCount() - lastButtonTime > sleepThres) {
if (gui_SolderingSleepingMode(false)) { if (gui_SolderingSleepingMode(false)) {
return; // If the function returns non-0 then exit return; // If the function returns non-0 then exit
} }
@@ -608,8 +559,7 @@ void showDebugMenu(void) {
{ {
uint32_t temp = systemSettings.CalibrationOffset; uint32_t temp = systemSettings.CalibrationOffset;
systemSettings.CalibrationOffset = 0; systemSettings.CalibrationOffset = 0;
OLED::printNumber( OLED::printNumber(TipThermoModel::convertTipRawADCTouV(getTipRawTemp(1)), 6);
TipThermoModel::convertTipRawADCTouV(getTipRawTemp(1)), 6);
systemSettings.CalibrationOffset = temp; systemSettings.CalibrationOffset = temp;
} }
break; break;
@@ -656,11 +606,9 @@ void startGUITask(void const *argument __unused) {
uint32_t ticks = xTaskGetTickCount(); uint32_t ticks = xTaskGetTickCount();
ticks += 400; // 4 seconds from now ticks += 400; // 4 seconds from now
while (xTaskGetTickCount() < ticks) { while (xTaskGetTickCount() < ticks) {
if (showBootLogoIfavailable() == false) if (showBootLogoIfavailable() == false) ticks = xTaskGetTickCount();
ticks = xTaskGetTickCount();
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
if (buttons) if (buttons) ticks = xTaskGetTickCount(); // make timeout now so we will exit
ticks = xTaskGetTickCount(); // make timeout now so we will exit
GUIDelay(); GUIDelay();
} }
@@ -672,7 +620,6 @@ void startGUITask(void const *argument __unused) {
OLED::print(SettingsResetMessage); OLED::print(SettingsResetMessage);
OLED::refresh(); OLED::refresh();
waitForButtonPressOrTimeout(1000); waitForButtonPressOrTimeout(1000);
} }
if (systemSettings.autoStartMode) { if (systemSettings.autoStartMode) {
@@ -695,8 +642,7 @@ void startGUITask(void const *argument __unused) {
OLED::setDisplayState(OLED::DisplayState::ON); OLED::setDisplayState(OLED::DisplayState::ON);
OLED::setFont(0); OLED::setFont(0);
} }
if (tempWarningState == 2) if (tempWarningState == 2) buttons = BUTTON_F_SHORT;
buttons = BUTTON_F_SHORT;
if (buttons != BUTTON_NONE && buttonLockout) if (buttons != BUTTON_NONE && buttonLockout)
buttons = BUTTON_NONE; buttons = BUTTON_NONE;
else else
@@ -742,11 +688,7 @@ void startGUITask(void const *argument __unused) {
// button presses) in a while. // button presses) in a while.
OLED::setDisplayState(OLED::DisplayState::ON); OLED::setDisplayState(OLED::DisplayState::ON);
if ((tipTemp < 50) && systemSettings.sensitivity if ((tipTemp < 50) && systemSettings.sensitivity && (((xTaskGetTickCount() - lastMovementTime) > MOVEMENT_INACTIVITY_TIME) && ((xTaskGetTickCount() - lastButtonTime) > BUTTON_INACTIVITY_TIME))) {
&& (((xTaskGetTickCount() - lastMovementTime)
> MOVEMENT_INACTIVITY_TIME)
&& ((xTaskGetTickCount() - lastButtonTime)
> BUTTON_INACTIVITY_TIME))) {
OLED::setDisplayState(OLED::DisplayState::OFF); OLED::setDisplayState(OLED::DisplayState::OFF);
} }
@@ -805,9 +747,7 @@ void startGUITask(void const *argument __unused) {
OLED::setCursor(0, 0); OLED::setCursor(0, 0);
} }
// draw in the temp // draw in the temp
if (!(systemSettings.coolingTempBlink if (!(systemSettings.coolingTempBlink && (xTaskGetTickCount() % 25 < 16))) gui_drawTipTemp(false); // draw in the temp
&& (xTaskGetTickCount() % 25 < 16)))
gui_drawTipTemp(false); // draw in the temp
} }
} }
OLED::refresh(); OLED::refresh();

View File

@@ -5,37 +5,26 @@
* Author: Ralim * Author: Ralim
*/ */
#include "main.hpp"
#include "BSP.h" #include "BSP.h"
#include "power.hpp" #include "FreeRTOS.h"
#include "history.hpp" #include "I2C_Wrapper.hpp"
#include "LIS2DH12.hpp"
#include "MMA8652FC.hpp"
#include "QC3.h"
#include "Settings.h"
#include "TipThermoModel.h" #include "TipThermoModel.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "FreeRTOS.h" #include "history.hpp"
#include "task.h" #include "main.hpp"
#include "Settings.h" #include "power.hpp"
#include "I2C_Wrapper.hpp"
#include "stdlib.h" #include "stdlib.h"
#include "LIS2DH12.hpp" #include "task.h"
#include <MMA8652FC.hpp>
#include "QC3.h"
#define MOVFilter 8 #define MOVFilter 8
uint8_t accelInit = 0; uint8_t accelInit = 0;
uint32_t lastMovementTime = 0; uint32_t lastMovementTime = 0;
void startMOVTask(void const *argument __unused) { void startMOVTask(void const *argument __unused) {
OLED::setRotation(true); OLED::setRotation(true);
postRToSInit();
#ifdef MODEL_TS80
startQC(systemSettings.voltageDiv);
while (pidTaskNotification == 0)
osDelay(30); // To ensure we return after idealQCVoltage/tip resistance
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
systemSettings.voltageDiv); // this will move the QC output to the preferred voltage to start with
#else
osDelay(250); // wait for accelerometer to stabilize
#endif
OLED::setRotation(systemSettings.OrientationMode & 1); OLED::setRotation(systemSettings.OrientationMode & 1);
lastMovementTime = 0; lastMovementTime = 0;
@@ -44,12 +33,8 @@ void startMOVTask(void const *argument __unused) {
int16_t dataz[MOVFilter] = {0}; int16_t dataz[MOVFilter] = {0};
uint8_t currentPointer = 0; uint8_t currentPointer = 0;
int16_t tx = 0, ty = 0, tz = 0; int16_t tx = 0, ty = 0, tz = 0;
int32_t avgx = 0, avgy = 0, avgz = 0; int32_t avgx, avgy, avgz;
if (systemSettings.sensitivity > 9) if (systemSettings.sensitivity > 9) systemSettings.sensitivity = 9;
systemSettings.sensitivity = 9;
#ifdef ACCELDEBUG
uint32_t max = 0;
#endif
Orientation rotation = ORIENTATION_FLAT; Orientation rotation = ORIENTATION_FLAT;
for (;;) { for (;;) {
int32_t threshold = 1500 + (9 * 200); int32_t threshold = 1500 + (9 * 200);
@@ -101,9 +86,6 @@ void startMOVTask(void const *argument __unused) {
} }
osDelay(100); // Slow down update rate osDelay(100); // Slow down update rate
#ifdef MODEL_TS80 QC_resync();
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
systemSettings.voltageDiv); // Run the QC seek again if we have drifted too much
#endif
} }
} }