forked from Akcelerometry_drgania_WMT/PI_mikrokontroler
Fix UploadManager CSV bottleneck and measure() race condition
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
class ADXL345FastSPI {
|
||||
public:
|
||||
static constexpr uint8_t MAX_SENSORS = 4; // Maksymalna liczba ADXL345
|
||||
|
||||
enum Rate { RATE_100HZ, RATE_200HZ, RATE_400HZ, RATE_800HZ, RATE_1600HZ, RATE_3200HZ };
|
||||
enum Range { RANGE_2G, RANGE_4G, RANGE_8G, RANGE_16G };
|
||||
|
||||
@@ -56,7 +58,7 @@ public:
|
||||
uint8_t refreshActiveMask();
|
||||
|
||||
private:
|
||||
static constexpr uint8_t MAX_NUM = 4; // MAX Ilość ADXL345
|
||||
static constexpr uint8_t MAX_NUM = MAX_SENSORS;
|
||||
|
||||
SPIClass* spi_ = &SPI;
|
||||
ADXL345FreshSPI dev_[MAX_NUM];
|
||||
|
||||
@@ -39,7 +39,7 @@ struct Config {
|
||||
char restUser[30]; // login RestAPI
|
||||
char restPass[50]; // hasło RestAPi
|
||||
uint8_t apiKey[32]; // Klucz API KEY
|
||||
uint16_t pause; // Pomiar co sekund
|
||||
uint32_t pause; // Pomiar co milisekund (ms)
|
||||
uint8_t duration; // Czas pomiaru w sekundach 1-25
|
||||
char S0[12]; // nazwy czujników 1-8
|
||||
char S1[12];
|
||||
@@ -53,6 +53,7 @@ struct Config {
|
||||
|
||||
// Global config declaration
|
||||
extern Config config;
|
||||
static_assert(sizeof(Config) + 1 <= EEPROM_SIZE, "Config struct exceeds EEPROM!");
|
||||
|
||||
class ConfigManager {
|
||||
public:
|
||||
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
bool ispress = (GPIO.in & (1UL << BTN_OK)) == 0;
|
||||
if(ispress) {
|
||||
isExit = true;
|
||||
measurementActive_;
|
||||
measurementActive_ = false;
|
||||
display_.textStatus("Cancelling. Wait!");
|
||||
}
|
||||
return ispress;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
#define VERSION "1.3.4.1"
|
||||
#define VERSION "1.3.4.2"
|
||||
|
||||
// 1: graphical 128x64, 2: LCD I2C Text 4x20
|
||||
#define LCD_TYPE 2
|
||||
|
||||
Reference in New Issue
Block a user