Compare commits

..

No commits in common. "b8c79955a88d4dcf0a1cd8400faee74b63b97f2c" and "8c2d553dfb622c1c931c86dbf55552968ef80288" have entirely different histories.

11 changed files with 57 additions and 138 deletions

View File

@ -73,38 +73,6 @@
<input class="form-control" type="text" placeholder="%SYSTEM_STATUS%" readonly> <input class="form-control" type="text" placeholder="%SYSTEM_STATUS%" readonly>
</p> </p>
<!-- Div Group current Mode --> <!-- Div Group current Mode -->
<!-- Div Group Faction Points -->
<hr />
<p>
<h4>aktueller Punktestand</h4>
<div class="table-responsive">
<table class="table table-borderless table-dark">
<thead>
<tr>
<th class="text-center" scope="col">%NAME_FAC_1%</th>
<th class="text-center" scope="col">%NAME_FAC_2%</th>
<th class="text-center" scope="col">%NAME_FAC_3%</th>
</tr>
</thead>
<tbody>
<tr>
<td class="mx-auto"><img src="static/img/logo_fac1.png" class="rounded mx-auto img-fluid d-block"
alt="..."></td>
<td class="mx-auto"><img src="static/img/logo_fac2.png" class="rounded mx-auto img-fluid d-block"
alt="..."></td>
<td class="mx-auto"><img src="static/img/logo_fac3.png" class="rounded mx-auto img-fluid d-block"
alt="..."></td>
</tr>
<tr>
<td class="text-center">%POINTS_FAC_1%</td>
<td class="text-center">%POINTS_FAC_2%</td>
<td class="text-center">%POINTS_FAC_3%</td>
</tr>
</tbody>
</table>
</div>
</p>
<!-- Div GroupFaction Points -->
<!-- Div Group DTC Table --> <!-- Div Group DTC Table -->
<div %SHOW_DTC_TABLE%> <div %SHOW_DTC_TABLE%>
<hr /> <hr />
@ -130,19 +98,6 @@
<!-- Div Tab Maintenance --> <!-- Div Tab Maintenance -->
<div id="tab_maintenance" class="tab-pane fade" role="tabpanel"> <div id="tab_maintenance" class="tab-pane fade" role="tabpanel">
<h3>Wartung</h3> <h3>Wartung</h3>
<!-- Div Group Reset Timers -->
<hr />
<p>
<h4>Punkte zur&uuml;cksetzen</h4>
<form action="post.htm" method="POST" class="form-horizontal">
<div class="form-group row">
<div class="col text-center">
<button name="resetpoints" type="submit" class="btn btn-outline-primary">Reset</button>
</div>
</div>
</form>
</p>
<!-- Div Group Reset Timers -->
<!-- Div Group EEPROM formatting --> <!-- Div Group EEPROM formatting -->
<hr /> <hr />
<p> <p>

View File

@ -21,7 +21,7 @@
--white: #fff; --white: #fff;
--gray: #6c757d; --gray: #6c757d;
--gray-dark: #343a40; --gray-dark: #343a40;
--primary: #bb1515; --primary: #FF550B;
--secondary: #303030; --secondary: #303030;
--success: #015668; --success: #015668;
--info: #0F81C7; --info: #0F81C7;
@ -1450,8 +1450,8 @@ fieldset:disabled a.btn {
.btn-primary { .btn-primary {
color: #fff; color: #fff;
background-color: #bb1515; background-color: #ff550b;
border-color: #bb1515; border-color: #ff550b;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075) box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075)
} }
@ -1469,8 +1469,8 @@ fieldset:disabled a.btn {
.btn-primary.disabled, .btn-primary.disabled,
.btn-primary:disabled { .btn-primary:disabled {
color: #fff; color: #fff;
background-color: #bb1515; background-color: #ff550b;
border-color: #bb1515 border-color: #ff550b
} }
.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled).active,
@ -1761,16 +1761,16 @@ fieldset:disabled a.btn {
} }
.btn-outline-primary { .btn-outline-primary {
color: #bb1515; color: #ff550b;
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
border-color: #bb1515 border-color: #ff550b
} }
.btn-outline-primary:hover { .btn-outline-primary:hover {
color: #fff; color: #fff;
background-color: #bb1515; background-color: #ff550b;
border-color: #bb1515 border-color: #ff550b
} }
.btn-outline-primary.focus, .btn-outline-primary.focus,
@ -1780,7 +1780,7 @@ fieldset:disabled a.btn {
.btn-outline-primary.disabled, .btn-outline-primary.disabled,
.btn-outline-primary:disabled { .btn-outline-primary:disabled {
color: #bb1515; color: #ff550b;
background-color: transparent background-color: transparent
} }
@ -1788,8 +1788,8 @@ fieldset:disabled a.btn {
.btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled):active,
.show>.btn-outline-primary.dropdown-toggle { .show>.btn-outline-primary.dropdown-toggle {
color: #fff; color: #fff;
background-color: #bb1515; background-color: #ff550b;
border-color: #bb1515 border-color: #ff550b
} }
.btn-outline-primary:not(:disabled):not(.disabled).active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus,
@ -2335,7 +2335,7 @@ input[type=submit].btn-block {
.dropdown-item:active { .dropdown-item:active {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
background-color: #bb1515 background-color: #ff550b
} }
.dropdown-item.disabled, .dropdown-item.disabled,
@ -2661,7 +2661,7 @@ input[type=submit].btn-block {
.custom-control-input:checked~.custom-control-label::before { .custom-control-input:checked~.custom-control-label::before {
color: #fff; color: #fff;
background-color: #bb1515; background-color: #ff550b;
box-shadow: none box-shadow: none
} }
@ -2720,7 +2720,7 @@ input[type=submit].btn-block {
} }
.custom-checkbox .custom-control-input:checked~.custom-control-label::before { .custom-checkbox .custom-control-input:checked~.custom-control-label::before {
background-color: #bb1515 background-color: #ff550b
} }
.custom-checkbox .custom-control-input:checked~.custom-control-label::after { .custom-checkbox .custom-control-input:checked~.custom-control-label::after {
@ -2728,7 +2728,7 @@ input[type=submit].btn-block {
} }
.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before { .custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before {
background-color: #bb1515; background-color: #ff550b;
box-shadow: none box-shadow: none
} }
@ -2749,7 +2749,7 @@ input[type=submit].btn-block {
} }
.custom-radio .custom-control-input:checked~.custom-control-label::before { .custom-radio .custom-control-input:checked~.custom-control-label::before {
background-color: #bb1515 background-color: #ff550b
} }
.custom-radio .custom-control-input:checked~.custom-control-label::after { .custom-radio .custom-control-input:checked~.custom-control-label::after {
@ -2898,7 +2898,7 @@ input[type=submit].btn-block {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
margin-top: -.25rem; margin-top: -.25rem;
background-color: #bb1515; background-color: #ff550b;
border: 0; border: 0;
border-radius: 1rem; border-radius: 1rem;
box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1); box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1);
@ -2928,7 +2928,7 @@ input[type=submit].btn-block {
.custom-range::-moz-range-thumb { .custom-range::-moz-range-thumb {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
background-color: #bb1515; background-color: #ff550b;
border: 0; border: 0;
border-radius: 1rem; border-radius: 1rem;
box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1); box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1);
@ -2958,7 +2958,7 @@ input[type=submit].btn-block {
.custom-range::-ms-thumb { .custom-range::-ms-thumb {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
background-color: #bb1515; background-color: #ff550b;
border: 0; border: 0;
border-radius: 1rem; border-radius: 1rem;
box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1); box-shadow: 0 .1rem .25rem rgba(0, 0, 0, .1);
@ -3063,7 +3063,7 @@ input[type=submit].btn-block {
.nav-pills .nav-link.active, .nav-pills .nav-link.active,
.nav-pills .show>.nav-link { .nav-pills .show>.nav-link {
color: #fff; color: #fff;
background-color: #bb1515 background-color: #ff550b
} }
.nav-fill .nav-item { .nav-fill .nav-item {
@ -3905,7 +3905,7 @@ input[type=submit].btn-block {
.badge-primary { .badge-primary {
color: #fff; color: #fff;
background-color: #bb1515 background-color: #ff550b
} }
.badge-primary[href]:focus, .badge-primary[href]:focus,
@ -4185,7 +4185,7 @@ input[type=submit].btn-block {
color: #6c757d; color: #6c757d;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
background-color: #bb1515; background-color: #ff550b;
transition: width .6s ease transition: width .6s ease
} }
@ -5184,7 +5184,7 @@ button.close {
} }
.bg-primary { .bg-primary {
background-color: #bb1515 !important background-color: #ff550b !important
} }
a.bg-primary:focus, a.bg-primary:focus,
@ -5320,7 +5320,7 @@ button.bg-dark:hover {
} }
.border-primary { .border-primary {
border-color: #bb1515 !important border-color: #ff550b !important
} }
.border-secondary { .border-secondary {
@ -8234,7 +8234,7 @@ button.bg-dark:hover {
} }
.text-primary { .text-primary {
color: #bb1515 !important color: #ff550b !important
} }
a.text-primary:focus, a.text-primary:focus,

View File

@ -13,7 +13,7 @@
#define HOST_NAME "AirsoftTimer_%08X" #define HOST_NAME "AirsoftTimer_%08X"
#define SHUTDOWN_DELAY_MS 5000 #define SHUTDOWN_DELAY_MS 5000
#define STARTUP_DELAY_MS 20000 #define RESETABLE_AFTER_STARTUP_MS 30000
#define GPIO_LORA_TX D3 #define GPIO_LORA_TX D3
#define GPIO_LORA_RX D4 #define GPIO_LORA_RX D4

View File

@ -9,7 +9,7 @@
#include "dtc.h" #include "dtc.h"
#include "common.h" #include "common.h"
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64 #define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC01
#define EEPROM_ENDURANCE 1000000 #define EEPROM_ENDURANCE 1000000
typedef enum typedef enum

View File

@ -11,13 +11,6 @@ typedef enum eSystem_Status
sysStat_Shutdown sysStat_Shutdown
} tSystem_Status; } tSystem_Status;
const char sSystem_Status_txt[][9] = {
"Startup",
"Normal",
"Error",
"Shutdown"
};
typedef enum eEERequest typedef enum eEERequest
{ {
EE_IDLE, EE_IDLE,
@ -38,6 +31,8 @@ typedef struct Globals_s
char DeviceName_ID[43]; char DeviceName_ID[43];
char FlashVersion[10]; char FlashVersion[10];
tSystem_Status systemStatus = sysStat_Startup; tSystem_Status systemStatus = sysStat_Startup;
tSystem_Status resumeStatus = sysStat_Startup;
char systemStatustxt[16] = "";
eEERequest requestEEAction = EE_IDLE; eEERequest requestEEAction = EE_IDLE;
uint16_t eePersistanceAdress; uint16_t eePersistanceAdress;
bool hasDTC; bool hasDTC;

View File

@ -2,27 +2,20 @@
#define _SANITYCHECK_H_ #define _SANITYCHECK_H_
#ifndef ADMIN_PASSWORD #ifndef ADMIN_PASSWORD
#error "You need to define ADMIN_PASSWORD for OTA-Update" #error "You need to define ADMIN_PASSWORD for OTA-Update"
#endif
#ifndef WIFI_PASSWORD
#error "You must define an WIFI_PASSWORD for OTA-Update"
#endif
#ifndef WIFI_SSID
#error "You must define an WIFI_SSID for OTA-Update"
#endif #endif
#ifndef WIFI_AP_SSID #ifndef WIFI_AP_SSID
#warning "No WIFI_AP_SSID defined. Using DeviceName" #warning "No WIFI_AP_SSID defined. Using DeviceName"
#define WIFI_AP_SSID DEVICE_NAME #define WIFI_AP_SSID DEVICE_NAME
#endif #endif
#ifndef WIFI_AP_PASSWORD #ifndef WIFI_AP_PASSWORD
#error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode" #error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode"
#endif #endif
#ifdef FEATURE_ENABLE_WIFI_CLIENT
#ifndef WIFI_CLIENT_PASSWORD
#error "You must define an WIFI_PASSWORD for OTA-Update"
#endif
#ifndef WIFI_CLIENT_SSID
#error "You must define an WIFI_SSID for OTA-Update"
#endif
#endif
#endif //_SANITYCHECK_H_ #endif //_SANITYCHECK_H_

View File

@ -27,13 +27,13 @@ upload_speed = 921600
build_flags= build_flags=
!python git_rev_macro.py !python git_rev_macro.py
-DATOMIC_FS_UPDATE -DATOMIC_FS_UPDATE
-DFEATURE_ENABLE_WIFI_CLIENT ;-DFEATURE_ENABLE_WIFI_CLIENT
;-DFEATURE_ENABLE_LORA ;-DFEATURE_ENABLE_LORA
;-DCAPTIVE ;-DCAPTIVE
-DWIFI_AP_IP_GW=10,0,0,1 -DWIFI_AP_IP_GW=10,0,0,1
-DADMIN_PASSWORD=${wifi_cred.admin_password} -DADMIN_PASSWORD=${wifi_cred.admin_password}
-DWIFI_CLIENT_SSID=${wifi_cred.wifi_client_ssid} -DWIFI_SSID=${wifi_cred.wifi_ssid}
-DWIFI_CLIENT_PASSWORD=${wifi_cred.wifi_client_password} -DWIFI_PASSWORD=${wifi_cred.wifi_password}
-DWIFI_AP_SSID=${wifi_cred.wifi_ap_ssid} -DWIFI_AP_SSID=${wifi_cred.wifi_ap_ssid}
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password} -DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
-DDEVICE_NAME='"Dark Emergency Timer"' -DDEVICE_NAME='"Dark Emergency Timer"'

View File

@ -33,7 +33,7 @@ void Debug_Process()
CMD_OVERFLOW CMD_OVERFLOW
} InputProcessed_t; } InputProcessed_t;
static unsigned int inputCnt = 0; static int inputCnt = 0;
static char inputBuffer[32]; static char inputBuffer[32];
InputProcessed_t InputProcessed = IDLE; InputProcessed_t InputProcessed = IDLE;
@ -204,6 +204,8 @@ void Debug_dumpConfig()
void Debug_dumpGlobals() void Debug_dumpGlobals()
{ {
Debug_pushMessage("systemStatus: %d\n", globals.systemStatus); Debug_pushMessage("systemStatus: %d\n", globals.systemStatus);
Debug_pushMessage("resumeStatus: %d\n", globals.resumeStatus);
Debug_pushMessage("systemStatustxt: %s\n", globals.systemStatustxt);
Debug_pushMessage("battery_level: %d\n", globals.battery_level); Debug_pushMessage("battery_level: %d\n", globals.battery_level);
Debug_pushMessage("loadvoltage_mV: %d\n", globals.loadvoltage_mV); Debug_pushMessage("loadvoltage_mV: %d\n", globals.loadvoltage_mV);
Debug_pushMessage("requestEEAction: %d\n", globals.requestEEAction); Debug_pushMessage("requestEEAction: %d\n", globals.requestEEAction);
@ -264,7 +266,7 @@ void Debug_ShowDTCs()
char buff_timestamp[16]; // Format: DD-hh:mm:ss:xxx char buff_timestamp[16]; // Format: DD-hh:mm:ss:xxx
char buff_active[9]; char buff_active[9];
Debug_pushMessage("\n timestamp | DTC-Nr. | status | severity | debugVal\n"); Debug_pushMessage("\n timestamp | DTC-Nr. | status | severity\n");
for (uint32_t i = 0; i < MAX_DTC_STORAGE; i++) for (uint32_t i = 0; i < MAX_DTC_STORAGE; i++)
{ {
@ -284,7 +286,7 @@ void Debug_ShowDTCs()
else else
strcpy(buff_active, "none"); strcpy(buff_active, "none");
Debug_pushMessage("%s %7d %8s %8d %8d\n", buff_timestamp, DTCStorage[i].Number, buff_active, DTCStorage[i].severity, DTCStorage[i].debugVal); Debug_pushMessage("%s %7d %8s %8d\n", buff_timestamp, DTCStorage[i].Number, buff_active, DTCStorage[i].severity);
} }
} }
} }

View File

@ -5,5 +5,6 @@ Globals_t globals;
void initGlobals() void initGlobals()
{ {
globals.systemStatus = sysStat_Startup; globals.systemStatus = sysStat_Startup;
globals.resumeStatus = sysStat_Normal;
globals.requestEEAction = EE_IDLE; globals.requestEEAction = EE_IDLE;
} }

View File

@ -89,16 +89,15 @@ void setup()
Serial.begin(115200); Serial.begin(115200);
Serial.setDebugOutput(false); Serial.setDebugOutput(false);
Serial.print("\n\n-------------------START-------------------\n"); Serial.println("\n\nDark Emergency Timer - by Hiabuto Defense");
Serial.print(globals.DeviceName); Serial.println(globals.DeviceName);
Serial.print("\nby Hiabuto Defense\n");
ClearAllDTC(); // Init DTC-Storage ClearAllDTC(); // Init DTC-Storage
InitEEPROM(); InitEEPROM();
GetConfig_EEPROM(); GetConfig_EEPROM();
GetPersistence_EEPROM(); GetPersistence_EEPROM();
Serial.print("EE-Init done\n"); Serial.print("\nEE-Init done");
if (i2c_io.begin()) if (i2c_io.begin())
{ {
@ -134,7 +133,7 @@ void setup()
#ifdef FEATURE_ENABLE_WIFI_CLIENT #ifdef FEATURE_ENABLE_WIFI_CLIENT
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.setHostname(globals.DeviceName); WiFi.setHostname(globals.DeviceName);
wifiMulti.addAP(QUOTE(WIFI_CLIENT_SSID), QUOTE(WIFI_CLIENT_PASSWORD)); wifiMulti.addAP(QUOTE(WIFI_SSID_CLIENT), QUOTE(WIFI_PASSWORD_CLIENT));
tmrWiFiMaintainConnection.start(); tmrWiFiMaintainConnection.start();
Serial.print("WiFi-Client Initialized\n"); Serial.print("WiFi-Client Initialized\n");
#else #else
@ -236,26 +235,8 @@ void loop()
#ifdef FEATURE_ENABLE_WIFI_CLIENT #ifdef FEATURE_ENABLE_WIFI_CLIENT
tmrWiFiMaintainConnection.update(); tmrWiFiMaintainConnection.update();
#endif #endif
if (globals.systemStatus == sysStat_Shutdown)
switch (globals.systemStatus)
{
case sysStat_Error:
/* code */
break;
case sysStat_Normal:
/* code */
break;
case sysStat_Shutdown:
SystemShutdown(); SystemShutdown();
break;
case sysStat_Startup:
if (millis() > STARTUP_DELAY_MS)
globals.systemStatus = sysStat_Normal;
break;
default:
break;
}
yield(); yield();
} }
@ -583,7 +564,7 @@ void ProcessKeyCombos(bool *btnState)
else if (keyCount_Fac2 == 4 && keyCount_Fac3 == 0) else if (keyCount_Fac2 == 4 && keyCount_Fac3 == 0)
{ {
Serial.printf("KeyCombo: Reset Timer\n"); Serial.printf("KeyCombo: Reset Timer\n");
if (globals.systemStatus == sysStat_Startup) if (millis() < RESETABLE_AFTER_STARTUP_MS)
{ {
OverrideDisplay("RST ", 5000); OverrideDisplay("RST ", 5000);
PersistenceData.faction_1_timer = 0; PersistenceData.faction_1_timer = 0;
@ -595,7 +576,7 @@ void ProcessKeyCombos(bool *btnState)
else else
{ {
OverrideDisplay("ERR ", 5000); OverrideDisplay("ERR ", 5000);
Serial.printf("ERROR: only %d seconds after Startup!\n", STARTUP_DELAY_MS / 1000); Serial.printf("ERROR: only %d seconds after Startup!\n", RESETABLE_AFTER_STARTUP_MS / 1000);
} }
} }

View File

@ -66,7 +66,7 @@ String processor(const String &var)
if (var == "HOSTNAME") if (var == "HOSTNAME")
return String(globals.DeviceName); return String(globals.DeviceName);
if (var == "SYSTEM_STATUS") if (var == "SYSTEM_STATUS")
return String(sSystem_Status_txt[globals.systemStatus]); return String(globals.systemStatustxt);
if (var == "SW_VERSION") if (var == "SW_VERSION")
{ {
char buffer[6]; char buffer[6];
@ -239,14 +239,6 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
{ {
globals.systemStatus = sysStat_Shutdown; globals.systemStatus = sysStat_Shutdown;
} }
if (p->name() == "resetpoints")
{
PersistenceData.faction_1_timer = 0;
PersistenceData.faction_2_timer = 0;
PersistenceData.faction_3_timer = 0;
PersistenceData.activeFaction = NONE;
globals.requestEEAction == EE_PDS_SAVE;
}
// end: POST Form Maintenance // end: POST Form Maintenance
// begin: POST Form Settings // begin: POST Form Settings