1
0
forked from me/IronOS

FIXUP! Fix typo's

.
This commit is contained in:
Ben V. Brown
2023-07-18 20:04:04 +10:00
parent 553f5fd273
commit 6002cc3270
5 changed files with 8 additions and 9 deletions

View File

@@ -34,7 +34,7 @@
#endif #endif
extern TickType_t lastMovementTime; extern TickType_t lastMovementTime;
extern OperatingMode currentMode; extern OperatingMode currentOperatingMode;
int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) { int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) {
if (attr == NULL || attr->uuid == NULL) { if (attr == NULL || attr->uuid == NULL) {
@@ -123,7 +123,7 @@ int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_att
break; break;
case 13: case 13:
// Operating mode // Operating mode
temp = currentMode; temp = (uint32_t)currentOperatingMode;
memcpy(buf, &temp, sizeof(temp)); memcpy(buf, &temp, sizeof(temp));
return sizeof(temp); return sizeof(temp);
break; break;
@@ -162,7 +162,7 @@ int ble_char_read_bulk_value_callback(struct bt_conn *conn, const struct bt_gatt
TipThermoModel::getTipMaxInC(), // 9 - max temp TipThermoModel::getTipMaxInC(), // 9 - max temp
TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), // 10 - Raw tip in μV TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), // 10 - Raw tip in μV
abs(getRawHallEffect()), // 11 - hall sensor abs(getRawHallEffect()), // 11 - hall sensor
currentMode, // 12 - Operating mode (uint32_t)currentOperatingMode, // 12 - Operating mode
x10WattHistory.average(), // 13 - Estimated Wattage *10 x10WattHistory.average(), // 13 - Estimated Wattage *10
}; };
int lenToCopy = sizeof(bulkData) - offset; int lenToCopy = sizeof(bulkData) - offset;

View File

@@ -105,6 +105,7 @@ void guiRenderLoop(void) {
newMode = performCJCC(buttons, &context); newMode = performCJCC(buttons, &context);
break; break;
case OperatingMode::SettingsMenu: case OperatingMode::SettingsMenu:
newMode = gui_SettingsMenu(buttons, &context);
break; break;
case OperatingMode::InitialisationDone: case OperatingMode::InitialisationDone:
newMode = handle_post_init_state(); newMode = handle_post_init_state();

View File

@@ -18,7 +18,7 @@ OperatingMode showDebugMenu(const ButtonState buttons, guiContext *cxt) {
// If device has validation code; then we want to take over both lines of the screen // If device has validation code; then we want to take over both lines of the screen
OLED::clearScreen(); // Ensure the buffer starts clean OLED::clearScreen(); // Ensure the buffer starts clean
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left) OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
OLED::print(DebugMenu[screen], FontStyle::SMALL); OLED::print(DebugMenu[cxt->scratch_state.state1], FontStyle::SMALL);
OLED::drawHex(getDeviceValidation(), FontStyle::SMALL, 8); OLED::drawHex(getDeviceValidation(), FontStyle::SMALL, 8);
OLED::setCursor(0, 8); // second line OLED::setCursor(0, 8); // second line
#endif #endif

View File

@@ -21,13 +21,10 @@ void renderHomeScreenAssets(void) {
} }
OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) { OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
if (buttons != BUTTON_NONE) {
OLED::setDisplayState(OLED::DisplayState::ON);
}
if (buttons != BUTTON_NONE && cxt->scratch_state.state1 == 0) { if (buttons != BUTTON_NONE && cxt->scratch_state.state1 == 0) {
return OperatingMode::HomeScreen; // Ignore button press return OperatingMode::HomeScreen; // Ignore button press
} else { } else {
cxt->scratch_state.state1 == 1; cxt->scratch_state.state1 = 1;
} }
switch (buttons) { switch (buttons) {
case BUTTON_NONE: case BUTTON_NONE:
@@ -46,7 +43,6 @@ OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
} }
#else #else
return OperatingMode::TemperatureAdjust; return OperatingMode::TemperatureAdjust;
saveSettings();
#endif #endif
break; break;
case BUTTON_F_SHORT: case BUTTON_F_SHORT:

View File

@@ -3,6 +3,8 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
// Render out the current settings menu // Render out the current settings menu
// State 1 -> Root menu // State 1 -> Root menu
// State 2 -> Sub entry // State 2 -> Sub entry
uint16_t *mainEntry = &(cxt->scratch_state.state1);
uint16_t *subEntry = &(cxt->scratch_state.state2);
return OperatingMode::HomeScreen; return OperatingMode::HomeScreen;
} }