Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed May 12, 2021
1 parent bee6da9 commit 6ade023
Show file tree
Hide file tree
Showing 27 changed files with 71,135 additions and 61,069 deletions.
49 changes: 26 additions & 23 deletions modular-psu-firmware.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -2184,6 +2184,11 @@
"type": "string",
"defaultValue": "MIO168 #1:"
},
{
"name": "slot_short_title",
"type": "string",
"defaultValue": "#1"
},
{
"name": "slot_error_message",
"type": "string",
Expand Down Expand Up @@ -33605,40 +33610,23 @@
"type": "Text",
"left": 0,
"top": 0,
"width": 28,
"height": 57,
"width": 52,
"height": 38,
"wireID": "786f607b-9c98-4972-9963-580b3bb69a49",
"data": "channel_short_title",
"action": "",
"style": {
"inheritFrom": "channel1",
"alignHorizontal": "left",
"alignVertical": "top",
"padding": "3 5"
},
"text": ""
},
{
"type": "Text",
"left": 28,
"top": 0,
"width": 24,
"height": 57,
"wireID": "b1ca1d29-b547-49e1-b258-05cc0f47f9f5",
"action": "toggle_channels_max_view",
"style": {
"inheritFrom": "channel1",
"font": "Heydings14",
"alignVertical": "top"
},
"text": "e"
},
{
"type": "Select",
"left": 0,
"top": 57,
"top": 38,
"width": 52,
"height": 57,
"height": 38,
"wireID": "991c1eff-3cbf-4adb-e763-b044810da4d9",
"data": "channel_protection_status",
"action": "show_ch_settings",
Expand All @@ -33651,7 +33639,7 @@
"left": 0,
"top": 0,
"width": 52,
"height": 57,
"height": 38,
"wireID": "6bb7f622-072f-43f5-f8cd-ef5062e610b0",
"action": "",
"style": {
Expand All @@ -33665,7 +33653,7 @@
"left": 0,
"top": 0,
"width": 52,
"height": 57,
"height": 38,
"wireID": "727c94c0-d072-4173-9147-cbd485e82a54",
"action": "",
"style": {
Expand All @@ -33677,6 +33665,21 @@
"text": "9"
}
]
},
{
"type": "Text",
"left": 0,
"top": 76,
"width": 52,
"height": 38,
"wireID": "b1ca1d29-b547-49e1-b258-05cc0f47f9f5",
"action": "toggle_channels_max_view",
"style": {
"inheritFrom": "channel1",
"font": "Heydings14",
"alignVertical": "top"
},
"text": "e"
}
],
"connectionLines": [],
Expand Down
4 changes: 4 additions & 0 deletions src/eez/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ void action_toggle_channels_max_view() {

void action_toggle_slot_max_view() {
auto slotIndex = getFoundWidgetAtDown().cursor;
hmi::selectSlot(slotIndex);

auto isMaxViewBefore = persist_conf::isMaxView();
auto wasFullScreenView = isMaxViewBefore && isSlotFullScreenView();
Expand Down Expand Up @@ -1208,6 +1209,9 @@ void onSelectFirmware() {
}

void action_channel_update_firmware() {
if (getActivePageId() == PAGE_ID_MAIN) {
hmi::selectSlot(getFoundWidgetAtDown().cursor);
}
yesNoDialog(PAGE_ID_YES_NO_FLASH_SLAVE, nullptr, onSelectFirmware, nullptr, nullptr);
}

Expand Down
1 change: 1 addition & 0 deletions src/eez/dlog_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void Writer::writeFileHeaderAndMetaFields(const Parameters &parameters) {

writeUint8Field(FIELD_ID_X_UNIT, parameters.xAxis.unit);
writeFloatField(FIELD_ID_X_STEP, parameters.xAxis.step);
m_xAxisStepFieldOffset = m_bufferIndex - 4;
writeUint8Field(FIELD_ID_X_SCALE_TYPE, parameters.xAxis.scaleType);
writeFloatField(FIELD_ID_X_RANGE_MIN, parameters.xAxis.range.min);
writeFloatField(FIELD_ID_X_RANGE_MAX, parameters.xAxis.range.max);
Expand Down
2 changes: 2 additions & 0 deletions src/eez/dlog_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ struct Writer {
uint32_t getBufferIndex() { return m_bufferIndex; }
uint32_t getDataOffset() { return m_dataOffset; }
uint32_t getFinishTimeFieldOffset() { return m_finalDurationFieldOffset; }
uint32_t getXAxisStepFieldOffset() { return m_xAxisStepFieldOffset; }
uint32_t getDataSizeFieldOffset() { return m_dataSizeFieldOffset; };
uint32_t getBookmarksSizeFieldOffset() { return m_bookmarksSizeFieldOffset; };
uint32_t getFileLength() { return m_fileLength; }
Expand All @@ -231,6 +232,7 @@ struct Writer {
uint8_t m_bits = 0;
uint32_t m_dataOffset = 0;
uint32_t m_finalDurationFieldOffset = 0;
uint32_t m_xAxisStepFieldOffset = 0;
uint32_t m_dataSizeFieldOffset = 0;
uint32_t m_bookmarksSizeFieldOffset = 0;

Expand Down
15 changes: 13 additions & 2 deletions src/eez/firmware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
#include <eez/sound.h>
#include <eez/memory.h>
#include <eez/usb.h>
#include <eez/modules/aux_ps/fan.h>

#include <eez/gui/gui.h>

#include <eez/modules/psu/psu.h>
#include <eez/modules/psu/channel_dispatcher.h>
#include <eez/modules/psu/sd_card.h>
#include <eez/modules/psu/serial_psu.h>
#include <eez/modules/psu/sd_card.h>
Expand Down Expand Up @@ -509,6 +511,9 @@ void shutdown() {

profile::saveIfDirty();

channel_dispatcher::disableOutputForAllChannels();
psu::tick();

if (psu::isPowerUp()) {
psu::changePowerState(false);
}
Expand Down Expand Up @@ -554,11 +559,17 @@ void shutdown() {
} else {
psu::gui::showShutdownPage();

#if defined(EEZ_PLATFORM_SIMULATOR)
osDelay(100);
#endif

g_shutdown = true;

#if defined(EEZ_PLATFORM_STM32)
while (1) {
WATCHDOG_RESET(WATCHDOG_LONG_OPERATION);
psu::tick();
osDelay(1);
}
#endif
}
}

Expand Down
Loading

0 comments on commit 6ade023

Please sign in to comment.