Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions src/_P073_7DGT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
//

/** History
* 2026-08-06 tonhuisman: Move display specific code in separate derived structs from P073_data_struct, and deduplicate code where possible
* 2026-07-27 tonhuisman: Restructure plugin_struct source into separate files per supported display model for maintainability
* Some minor code optimization for 74HC595 displays
* 2026-07-25 tonhuisman: Use Arduino pin initialization as some ESPs don't properly set up their pins with DIRECT_GPIO_OUTPUT
* 2026-07-24 tonhuisman: Fix 7dn and 7dt commands for 74HC595 to show data correctly for display setups with less than 8 digits
* Improve update speed for 74HC595 by using DIRECT_GPIO library for all GPIO commands (also for TM1637 and MAX7219)
* 2026-07-21 tonhuisman: Fix wrong content displayed on 74HC595 displays (multiple fixes)
* 2026-01-17 tonhuisman: Revert to using 'regular' Arduino GPIO functions for TM1637 displays on ESP8266
* 2026-01-12 tonhuisman: Fix initialization of number of digits when upgrading to 20260108 build,
* formatted source with new Uncrustify config
Expand Down Expand Up @@ -308,21 +315,28 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)

case PLUGIN_INIT:
{
initPluginTaskData(event->TaskIndex, new (std::nothrow) P073_data_struct());
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));

if (nullptr != P073_data) {
P073_data->init(event);
P073_data_struct *P073_data = nullptr;

switch (P073_CFG_DISPLAYTYPE)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
case P073_TM1637_6DGT:
P073_data = new (std::nothrow) P073_TM1637(event);
break;
case P073_MAX7219_8DGT:
P073_data = new (std::nothrow) P073_MAX7219(event);
break;
# if P073_USE_74HC595

if (P073_data->is74HC595Matrix()) {
Scheduler.setPluginTaskTimer(10, event->TaskIndex, 0);
}
case P073_74HC595_2_8DGT:
P073_data = new (std::nothrow) P073_74HC595(event);
break;
# endif // if P073_USE_74HC595
}

success = true;
if (nullptr != P073_data) {
initPluginTaskData(event->TaskIndex, P073_data);
success = P073_data->init(event);
}
break;
}
Expand Down Expand Up @@ -375,7 +389,7 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
success = P073_data->plugin_fifty_per_second(event);

if (success) {
Scheduler.setPluginTaskTimer(0, event->TaskIndex, 0);
Scheduler.setPluginTaskTimer(5, event->TaskIndex, 0);
}

// success = false; // Don't send out to (not configurable) Controllers or Rules
Expand Down
Loading