Skip to content

Commit

Permalink
release R2304
Browse files Browse the repository at this point in the history
  • Loading branch information
maierkomor committed May 1, 2023
1 parent a651849 commit 249f1b0
Show file tree
Hide file tree
Showing 83 changed files with 6,432 additions and 7,803 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.5)
add_compile_definitions(ESP$ENV{ESP_FAM})
add_compile_definitions(IDF_VERSION=$ENV{IDF_VERSION})
add_compile_definitions(FWCFG="$ENV{FWCFG}")
add_link_options(LINKER:SHELL:"-gc-sections,--defsym,LDTIMESTAMP=$ENV{TIMESTAMP}")
#set(FWCFG $ENV{FWCFG}) # ignored - for whatever reason...

#add_compile_definitions(FWCFG="$ENV{FWCFG}")
Expand Down
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
R2304:
======
- added command line comment suport to ignore lines starting with a #
- added core file handling support, including direct http download
- added FTP binary transfer support
- enhanced sm command to print all event/action associations of states
- output of ls command could be better
- timer infrastructure must deal with invalid timer ids
- more event statistics
- added busy LED that shows activity of event and cyclic processing
- update stt command
- TCA9555 init fix
- fix: env output ignores printing format
- fix: timer argument parsing error

R2303:
======
- added script for convenient flashing
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,16 @@ a file, just executed e.g. `cp /usb/myfile.lua .`. This will copy the
file to the current directory, which is per default `/flash`.


Crash dumps:
============
Atrium projects for 4MB flash size are configured with a core dump
partition and include infrastructure to save and download crash dumps.
For this, the `dumpadm` command is available that allows copying the
current crash dump to a writable storeage filesystem. Additionally, if
the internal www server is started, a download of `http://nodename/core`
will download the core binary from the crash partition.


Known Issues:
=============
- The documentation is incomplete and not completely up-to-date
Expand Down
2 changes: 1 addition & 1 deletion components/actions/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Action *action_add(const char *name, void (*func)(void *), void *arg, const char
log_dbug(TAG,"add %s",name);
return (Action*) &(*Actions.emplace(name,func,arg,text).first);
}
log_warn(TAG,"duplicated action %s",name);
log_warn(TAG,"action exists: %s",name);
}
return 0;
}
Expand Down
10 changes: 10 additions & 0 deletions components/cyclic/cyclic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ static SubTask *SubTasks = 0;
static SemaphoreHandle_t Mtx = 0;
static volatile uint64_t TimeSpent = 0;

#ifdef CONFIG_ESPTOOLPY_FLASHSIZE_1MB
#define busy_set(...)
#elif defined CONFIG_LEDS
extern "C" void busy_set(int on);
#else
#define busy_set(...)
#endif


int cyclic_add_task(const char *name, unsigned (*loop)(void*), void *arg, unsigned initdelay)
{
Expand Down Expand Up @@ -134,7 +142,9 @@ unsigned cyclic_execute()
if (off <= 0) {
lock.unlock();
// con_printf("subtask => %s\n",t->name);
busy_set(true);
unsigned d = t->code(t->arg);
busy_set(false);
int64_t end = esp_timer_get_time();
lock.lock();
t->nextrun = end + (uint64_t)d * 1000LL;
Expand Down
28 changes: 21 additions & 7 deletions components/env/env.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022, Thomas Maier-Komor
* Copyright (C) 2020-2023, Thomas Maier-Komor
* Atrium Firmware Package for ESP
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -22,6 +22,8 @@
#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdio.h>

#include <algorithm>

using namespace std;
Expand Down Expand Up @@ -89,16 +91,13 @@ void EnvNumber::set(float v)
event_trigger(m_evhi);
m_tst = 1;
}
} else if (m_tst >= 0) {
}
// no else for m_tst == 0 to work below
if (m_tst >= 0) {
if (v < m_low) {
event_trigger(m_evlo);
m_tst = -1;
}
} else {
if (v > m_high)
m_tst = 1;
else if (v < m_low)
m_tst = -1;
}
}
}
Expand All @@ -120,8 +119,23 @@ int EnvNumber::setThresholds(float l, float h, const char *n)

void EnvNumber::writeValue(stream &o) const
{
// writeValue is used for influx
// i.e. spaces must not be included in the output
if (isValid()) {
#ifdef CONFIG_ESPTOOLPY_FLASHSIZE_1MB
// variant needed if printf %f support is missing
o << get();
#else
char buf[128];
int n = snprintf(buf,sizeof(buf),m_fmt,m_value);
assert((n > 0) && (n < sizeof(buf)));
char *b = buf;
while (*b == ' ') {
++b;
--n;
}
o.write(b,n);
#endif
} else if (m_dim) {
o.write("NaN",3);
} else {
Expand Down
Loading

0 comments on commit 249f1b0

Please sign in to comment.