Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 28a2bf75e3 | |||
| c9887a563e | |||
| 15ca82b6df | |||
| d700578256 | |||
| 10f8026c6d | |||
| dc56990f1e | |||
| a9d5bcfd66 | |||
| 9bb66a9459 | |||
| aa9935ef22 | |||
| 79dbd5db5d | |||
| 94c5c7491a |
@@ -36,7 +36,6 @@
|
||||
<div class="box-data">
|
||||
<p><strong>Timestamp:</strong> <span id="a_timestamp">-</span></p>
|
||||
<p><strong>Data Valid:</strong> <span id="a_datavalid">-</span></p>
|
||||
<p><strong>Generator voltage:</strong> <span id="a_volts_gen">-</span></p>
|
||||
<p><strong>ADC read time:</strong> <span id="a_adc_read_time">-</span></p>
|
||||
<p><strong>Queue errors:</strong> <span id="a_n_queue_errors">-</span></p>
|
||||
</div>
|
||||
@@ -111,7 +110,6 @@
|
||||
<div class="box-data">
|
||||
<p><strong>Timestamp:</strong> <span id="b_timestamp">-</span></p>
|
||||
<p><strong>Data Valid:</strong> <span id="b_datavalid">-</span></p>
|
||||
<p><strong>Generator voltage:</strong> <span id="b_volts_gen">-</span></p>
|
||||
<p><strong>ADC read time:</strong> <span id="b_adc_read_time">-</span></p>
|
||||
<p><strong>Queue errors:</strong> <span id="b_n_queue_errors">-</span></p>
|
||||
</div>
|
||||
|
||||
+42
-48
@@ -78,34 +78,31 @@ function connectWS() {
|
||||
const boxA = data.box_a;
|
||||
document.getElementById("a_datavalid").textContent = boxA.datavalid ?? "-";
|
||||
document.getElementById("a_timestamp").textContent = boxA.timestamp ?? "-";
|
||||
document.getElementById("a_volts_gen").textContent = boxA.volts_gen ?? "-";
|
||||
document.getElementById("a_eng_rpm").textContent = boxA.eng_rpm ?? "-";
|
||||
document.getElementById("a_adc_read_time").textContent = boxA.adc_read_time ?? "-";
|
||||
document.getElementById("a_n_queue_errors").textContent = boxA.n_queue_errors ?? "-";
|
||||
document.getElementById("a_eng_rpm").textContent = boxA.engRpm ?? "-";
|
||||
document.getElementById("a_adc_read_time").textContent = boxA.adcReadTime ?? "-";
|
||||
document.getElementById("a_n_queue_errors").textContent = boxA.nQueueErrors ?? "-";
|
||||
|
||||
const coils12A = boxA.coils12 || {};
|
||||
const coils34A = boxA.coils34 || {};
|
||||
|
||||
document.getElementById("a_coils12_spark_delay").textContent = coils12A.spark_delay ?? "-";
|
||||
document.getElementById("a_coils34_spark_delay").textContent = coils34A.spark_delay ?? "-";
|
||||
document.getElementById("a_coils12_spark_status").textContent = coils12A.spark_status ?? "-";
|
||||
document.getElementById("a_coils34_spark_status").textContent = coils34A.spark_status ?? "-";
|
||||
document.getElementById("a_coils12_sstart_status").textContent = coils12A.sstart_status ?? "-";
|
||||
document.getElementById("a_coils34_sstart_status").textContent = coils34A.sstart_status ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_in").textContent = coils12A.peak_p_in ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_in").textContent = coils34A.peak_p_in ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_in").textContent = coils12A.peak_n_in ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_in").textContent = coils34A.peak_n_in ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_out").textContent = coils12A.peak_p_out ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_out").textContent = coils34A.peak_p_out ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_out").textContent = coils12A.peak_n_out ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_out").textContent = coils34A.peak_n_out ?? "-";
|
||||
document.getElementById("a_coils12_level_spark").textContent = coils12A.level_spark ?? "-";
|
||||
document.getElementById("a_coils34_level_spark").textContent = coils34A.level_spark ?? "-";
|
||||
document.getElementById("a_coils12_n_events").textContent = coils12A.n_events ?? "-";
|
||||
document.getElementById("a_coils34_n_events").textContent = coils34A.n_events ?? "-";
|
||||
document.getElementById("a_coils12_n_missed_firing").textContent = coils12A.n_missed_firing ?? "-";
|
||||
document.getElementById("a_coils34_n_missed_firing").textContent = coils34A.n_missed_firing ?? "-";
|
||||
document.getElementById("a_coils12_spark_delay").textContent = coils12A.sparkDelay ?? "-";
|
||||
document.getElementById("a_coils34_spark_delay").textContent = coils34A.sparkDelay ?? "-";
|
||||
document.getElementById("a_coils12_spark_status").textContent = coils12A.sparkStatus ?? "-";
|
||||
document.getElementById("a_coils34_spark_status").textContent = coils34A.sparkStatus ?? "-";
|
||||
document.getElementById("a_coils12_sstart_status").textContent = coils12A.softStartStatus ?? "-";
|
||||
document.getElementById("a_coils34_sstart_status").textContent = coils34A.softStartStatus ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_in").textContent = coils12A.peakPos ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_in").textContent = coils34A.peakPos ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_in").textContent = coils12A.peakNeg ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_in").textContent = coils34A.peakNeg ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_out").textContent = coils12A.trigLevelPos ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_out").textContent = coils34A.trigLevelPos ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_out").textContent = coils12A.trigLevelNeg ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_out").textContent = coils34A.trigLevelNeg ?? "-";
|
||||
document.getElementById("a_coils12_n_events").textContent = coils12A.nEvents ?? "-";
|
||||
document.getElementById("a_coils34_n_events").textContent = coils34A.nEvents ?? "-";
|
||||
document.getElementById("a_coils12_n_missed_firing").textContent = coils12A.nMissedFiring ?? "-";
|
||||
document.getElementById("a_coils34_n_missed_firing").textContent = coils34A.nMissedFiring ?? "-";
|
||||
}
|
||||
|
||||
// Update Box_B
|
||||
@@ -113,34 +110,31 @@ function connectWS() {
|
||||
const boxB = data.box_b;
|
||||
document.getElementById("b_datavalid").textContent = boxB.datavalid ?? "-";
|
||||
document.getElementById("b_timestamp").textContent = boxB.timestamp ?? "-";
|
||||
document.getElementById("b_volts_gen").textContent = boxB.volts_gen ?? "-";
|
||||
document.getElementById("b_eng_rpm").textContent = boxB.eng_rpm ?? "-";
|
||||
document.getElementById("b_adc_read_time").textContent = boxB.adc_read_time ?? "-";
|
||||
document.getElementById("b_n_queue_errors").textContent = boxB.n_queue_errors ?? "-";
|
||||
document.getElementById("b_eng_rpm").textContent = boxB.engRpm ?? "-";
|
||||
document.getElementById("b_adc_read_time").textContent = boxB.adcReadTime ?? "-";
|
||||
document.getElementById("b_n_queue_errors").textContent = boxB.nQueueErrors ?? "-";
|
||||
|
||||
const coils12B = boxB.coils12 || {};
|
||||
const coils34B = boxB.coils34 || {};
|
||||
|
||||
document.getElementById("b_coils12_spark_delay").textContent = coils12B.spark_delay ?? "-";
|
||||
document.getElementById("b_coils34_spark_delay").textContent = coils34B.spark_delay ?? "-";
|
||||
document.getElementById("b_coils12_spark_status").textContent = coils12B.spark_status ?? "-";
|
||||
document.getElementById("b_coils34_spark_status").textContent = coils34B.spark_status ?? "-";
|
||||
document.getElementById("b_coils12_sstart_status").textContent = coils12B.sstart_status ?? "-";
|
||||
document.getElementById("b_coils34_sstart_status").textContent = coils34B.sstart_status ?? "-";
|
||||
document.getElementById("b_coils12_peak_p_in").textContent = coils12B.peak_p_in ?? "-";
|
||||
document.getElementById("b_coils34_peak_p_in").textContent = coils34B.peak_p_in ?? "-";
|
||||
document.getElementById("b_coils12_peak_n_in").textContent = coils12B.peak_n_in ?? "-";
|
||||
document.getElementById("b_coils34_peak_n_in").textContent = coils34B.peak_n_in ?? "-";
|
||||
document.getElementById("b_coils12_peak_p_out").textContent = coils12B.peak_p_out ?? "-";
|
||||
document.getElementById("b_coils34_peak_p_out").textContent = coils34B.peak_p_out ?? "-";
|
||||
document.getElementById("b_coils12_peak_n_out").textContent = coils12B.peak_n_out ?? "-";
|
||||
document.getElementById("b_coils34_peak_n_out").textContent = coils34B.peak_n_out ?? "-";
|
||||
document.getElementById("b_coils12_level_spark").textContent = coils12B.level_spark ?? "-";
|
||||
document.getElementById("b_coils34_level_spark").textContent = coils34B.level_spark ?? "-";
|
||||
document.getElementById("b_coils12_n_events").textContent = coils12B.n_events ?? "-";
|
||||
document.getElementById("b_coils34_n_events").textContent = coils34B.n_events ?? "-";
|
||||
document.getElementById("b_coils12_n_missed_firing").textContent = coils12B.n_missed_firing ?? "-";
|
||||
document.getElementById("b_coils34_n_missed_firing").textContent = coils34B.n_missed_firing ?? "-";
|
||||
document.getElementById("a_coils12_spark_delay").textContent = coils12B.sparkDelay ?? "-";
|
||||
document.getElementById("a_coils34_spark_delay").textContent = coils34B.sparkDelay ?? "-";
|
||||
document.getElementById("a_coils12_spark_status").textContent = coils12B.sparkStatus ?? "-";
|
||||
document.getElementById("a_coils34_spark_status").textContent = coils34B.sparkStatus ?? "-";
|
||||
document.getElementById("a_coils12_sstart_status").textContent = coils12B.softStartStatus ?? "-";
|
||||
document.getElementById("a_coils34_sstart_status").textContent = coils34B.softStartStatus ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_in").textContent = coils12B.peakPos ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_in").textContent = coils34B.peakPos ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_in").textContent = coils12B.peakNeg ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_in").textContent = coils34B.peakNeg ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_out").textContent = coils12B.trigLevelPos ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_out").textContent = coils34B.trigLevelPos ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_out").textContent = coils12B.trigLevelNeg ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_out").textContent = coils34B.trigLevelNeg ?? "-";
|
||||
document.getElementById("a_coils12_n_events").textContent = coils12B.nEvents ?? "-";
|
||||
document.getElementById("a_coils34_n_events").textContent = coils34B.nEvents ?? "-";
|
||||
document.getElementById("a_coils12_n_missed_firing").textContent = coils12B.nMissedFiring ?? "-";
|
||||
document.getElementById("a_coils34_n_missed_firing").textContent = coils34B.nMissedFiring ?? "-";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,8 @@
|
||||
RadoMmm for suggesting an improvement on the ADC-to-Volts conversion
|
||||
*/
|
||||
|
||||
#define DEBUGLOG_DEFAULT_LOG_LEVEL_DEBUG
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "ADS1256.h"
|
||||
#include "SPI.h"
|
||||
@@ -62,16 +64,18 @@ ADS1256::ADS1256(const int8_t DRDY_pin, const int8_t RESET_pin, const int8_t SYN
|
||||
|
||||
updateConversionParameter();
|
||||
|
||||
// m_drdyHigh = xSemaphoreCreateBinary();
|
||||
// m_drdyLow = xSemaphoreCreateBinary();
|
||||
// if (!m_drdyHigh || !m_drdyLow) {
|
||||
// LOG_ERROR("ADC Unable to create interrupt semaphores");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// xSemaphoreGive(m_drdyHigh);
|
||||
// xSemaphoreGive(m_drdyLow);
|
||||
//attachInterruptArg(DRDY_pin, drdyCallback, (void *)this, CHANGE);
|
||||
m_drdyHigh = xSemaphoreCreateBinary();
|
||||
m_drdyLow = xSemaphoreCreateBinary();
|
||||
if (!m_drdyHigh || !m_drdyLow)
|
||||
{
|
||||
LOG_ERROR("ADC Unable to create interrupt semaphores");
|
||||
return;
|
||||
}
|
||||
|
||||
xSemaphoreGive(m_drdyHigh);
|
||||
xSemaphoreGive(m_drdyLow);
|
||||
attachInterruptArg(DRDY_pin, drdyCallback, (void *)this, CHANGE);
|
||||
disableInterrupt(DRDY_pin);
|
||||
}
|
||||
|
||||
// Initialization
|
||||
@@ -84,7 +88,7 @@ void ADS1256::InitializeADC()
|
||||
if (m_RESET_pin != PIN_UNUSED)
|
||||
{
|
||||
digitalWrite(m_RESET_pin, LOW);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
digitalWrite(m_RESET_pin, HIGH); // RESET is set to high
|
||||
delay(1000);
|
||||
}
|
||||
@@ -97,44 +101,48 @@ void ADS1256::InitializeADC()
|
||||
|
||||
// Applying arbitrary default values to speed up the starting procedure if the user just want to get quick readouts
|
||||
// We both pass values to the variables and then send those values to the corresponding registers
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
m_STATUS = 0b00110110; // BUFEN and ACAL enabled, Order is MSB, rest is read only
|
||||
writeRegister(STATUS_REG, m_STATUS);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
m_MUX = DIFF_0_1; // MUX AIN0+AIN1
|
||||
writeRegister(MUX_REG, m_MUX);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
m_ADCON = WAKEUP; // ADCON - CLK: OFF, SDCS: OFF, PGA = 0 (+/- 5 V)
|
||||
writeRegister(ADCON_REG, m_ADCON);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
updateConversionParameter();
|
||||
|
||||
m_DRATE = DRATE_100SPS; // 100SPS
|
||||
writeRegister(DRATE_REG, m_DRATE);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
sendDirectCommand(SELFCAL); // Offset and self-gain calibration
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
m_isAcquisitionRunning = false; // MCU will be waiting to start a continuous acquisition
|
||||
}
|
||||
|
||||
void ADS1256::waitForLowDRDY()
|
||||
{
|
||||
while(digitalRead(m_DRDY_pin) == HIGH) {vTaskDelay(1);};
|
||||
// xSemaphoreTake(m_drdyLow, pdMS_TO_TICKS(10));
|
||||
// xSemaphoreGive(m_drdyLow);
|
||||
if (!m_isAcquisitionRunning)
|
||||
while (digitalRead(m_DRDY_pin) == HIGH)
|
||||
; // wait in loop only for single shot modes
|
||||
xSemaphoreTake(m_drdyLow, pdMS_TO_TICKS(10));
|
||||
xSemaphoreGive(m_drdyLow);
|
||||
}
|
||||
|
||||
void ADS1256::waitForHighDRDY()
|
||||
{
|
||||
while(digitalRead(m_DRDY_pin) == LOW) {vTaskDelay(1);};
|
||||
// xSemaphoreTake(m_drdyHigh, pdMS_TO_TICKS(10));
|
||||
// xSemaphoreGive(m_drdyHigh);
|
||||
if (!m_isAcquisitionRunning)
|
||||
while (digitalRead(m_DRDY_pin) == LOW)
|
||||
; // wait in loop only for single shot modes
|
||||
xSemaphoreTake(m_drdyHigh, pdMS_TO_TICKS(10));
|
||||
xSemaphoreGive(m_drdyHigh);
|
||||
}
|
||||
|
||||
void ADS1256::stopConversion() // Sending SDATAC to stop the continuous conversion
|
||||
@@ -145,20 +153,21 @@ void ADS1256::stopConversion() // Sending SDATAC to stop the continuous conversi
|
||||
_spi->endTransaction();
|
||||
|
||||
m_isAcquisitionRunning = false; // Reset to false, so the MCU will be able to start a new conversion
|
||||
disableDRDYinterrupt();
|
||||
}
|
||||
|
||||
void ADS1256::setDRATE(uint8_t drate) // Setting DRATE (sampling frequency)
|
||||
{
|
||||
writeRegister(DRATE_REG, drate);
|
||||
m_DRATE = drate;
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
}
|
||||
|
||||
void ADS1256::setMUX(uint8_t mux) // Setting MUX (input channel)
|
||||
{
|
||||
writeRegister(MUX_REG, mux);
|
||||
m_MUX = mux;
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
}
|
||||
|
||||
void ADS1256::setPGA(uint8_t pga) // Setting PGA (input voltage range)
|
||||
@@ -169,7 +178,7 @@ void ADS1256::setPGA(uint8_t pga) // Setting PGA (input voltage range)
|
||||
m_ADCON = (m_ADCON & 0b11111000) | (m_PGA & 0b00000111); // Clearing and then setting bits 2-0 based on pga
|
||||
|
||||
writeRegister(ADCON_REG, m_ADCON);
|
||||
delay(200);
|
||||
delayMicroseconds(500);
|
||||
|
||||
updateConversionParameter(); // Update the multiplier according top the new PGA value
|
||||
}
|
||||
@@ -217,7 +226,6 @@ void ADS1256::setCLKOUT(uint8_t clkout) // Setting CLKOUT
|
||||
}
|
||||
|
||||
writeRegister(ADCON_REG, m_ADCON);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
void ADS1256::setSDCS(uint8_t sdcs) // Setting SDCS
|
||||
@@ -255,7 +263,6 @@ void ADS1256::setSDCS(uint8_t sdcs) // Setting SDCS
|
||||
}
|
||||
|
||||
writeRegister(ADCON_REG, m_ADCON);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
void ADS1256::setByteOrder(uint8_t byteOrder) // Setting byte order (MSB/LSB)
|
||||
@@ -279,7 +286,6 @@ void ADS1256::setByteOrder(uint8_t byteOrder) // Setting byte order (MSB/LSB)
|
||||
}
|
||||
|
||||
writeRegister(STATUS_REG, m_STATUS);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
uint8_t ADS1256::getByteOrder() // Getting byte order (MSB/LSB)
|
||||
@@ -310,7 +316,6 @@ void ADS1256::setAutoCal(uint8_t acal) // Setting ACAL (Automatic SYSCAL)
|
||||
}
|
||||
|
||||
writeRegister(STATUS_REG, m_STATUS);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
uint8_t ADS1256::getAutoCal() // Getting ACAL (Automatic SYSCAL)
|
||||
@@ -341,7 +346,6 @@ void ADS1256::setBuffer(uint8_t bufen) // Setting input buffer (Input impedance)
|
||||
}
|
||||
|
||||
writeRegister(STATUS_REG, m_STATUS);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
uint8_t ADS1256::getBuffer() // Getting input buffer (Input impedance)
|
||||
@@ -405,7 +409,6 @@ void ADS1256::setGPIO(uint8_t dir0, uint8_t dir1, uint8_t dir2, uint8_t dir3) //
|
||||
//-----------------------------------------------------
|
||||
|
||||
writeRegister(IO_REG, m_GPIO);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
void ADS1256::writeGPIO(uint8_t dir0value, uint8_t dir1value, uint8_t dir2value, uint8_t dir3value) // Writing GPIO
|
||||
@@ -463,7 +466,6 @@ void ADS1256::writeGPIO(uint8_t dir0value, uint8_t dir1value, uint8_t dir2value,
|
||||
//-----------------------------------------------------
|
||||
|
||||
writeRegister(IO_REG, m_GPIO);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
uint8_t ADS1256::readGPIO(uint8_t gpioPin) // Reading GPIO
|
||||
@@ -478,8 +480,6 @@ uint8_t ADS1256::readGPIO(uint8_t gpioPin) // Reading GPIO
|
||||
GPIO_bit1 = bitRead(m_GPIO, 1);
|
||||
GPIO_bit0 = bitRead(m_GPIO, 0);
|
||||
|
||||
delay(100);
|
||||
|
||||
switch (gpioPin) // Selecting which value should be returned
|
||||
{
|
||||
case 0:
|
||||
@@ -524,45 +524,32 @@ float ADS1256::convertToVoltage(int32_t rawData) // Converting the 24-bit data i
|
||||
void ADS1256::writeRegister(uint8_t registerAddress, uint8_t registerValueToWrite)
|
||||
{
|
||||
waitForLowDRDY();
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1)); // SPI_MODE1 = output edge: rising, data capture: falling; clock polarity: 0, clock phase: 1.
|
||||
CS_LOW(); // CS must stay LOW during the entire sequence [Ref: P34, T24]
|
||||
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1));
|
||||
// SPI_MODE1 = output edge: rising, data capture: falling; clock polarity: 0, clock phase: 1.
|
||||
|
||||
CS_LOW(); // CS must stay LOW during the entire sequence [Ref: P34, T24]
|
||||
|
||||
delayMicroseconds(5); // see t6 in the datasheet
|
||||
|
||||
delayMicroseconds(5); // see t6 in the datasheet
|
||||
_spi->transfer(WREG | registerAddress); // 0x50 = 01010000 = WREG
|
||||
|
||||
_spi->transfer(0x00); // 2nd (empty) command byte
|
||||
|
||||
_spi->transfer(registerValueToWrite); // pass the value to the register
|
||||
_spi->transfer(0x00); // 2nd (empty) command byte
|
||||
_spi->transfer(registerValueToWrite); // pass the value to the register
|
||||
|
||||
CS_HIGH();
|
||||
_spi->endTransaction();
|
||||
delay(100);
|
||||
}
|
||||
|
||||
long ADS1256::readRegister(uint8_t registerAddress) // Reading a register
|
||||
{
|
||||
waitForLowDRDY();
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1)); // SPI_MODE1 = output edge: rising, data capture: falling; clock polarity: 0, clock phase: 1.
|
||||
CS_LOW(); // CS must stay LOW during the entire sequence [Ref: P34, T24]
|
||||
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1));
|
||||
// SPI_MODE1 = output edge: rising, data capture: falling; clock polarity: 0, clock phase: 1.
|
||||
|
||||
CS_LOW(); // CS must stay LOW during the entire sequence [Ref: P34, T24]
|
||||
|
||||
_spi->transfer(RREG | registerAddress); // 0x10 = 0001000 = RREG - OR together the two numbers (command + address)
|
||||
|
||||
_spi->transfer(0x00); // 2nd (empty) command byte
|
||||
|
||||
delayMicroseconds(5); // see t6 in the datasheet
|
||||
|
||||
_spi->transfer(RREG | registerAddress); // 0x10 = 0001000 = RREG - OR together the two numbers (command + address)
|
||||
_spi->transfer(0x00); // 2nd (empty) command byte
|
||||
delayMicroseconds(5); // see t6 in the datasheet
|
||||
uint8_t regValue = _spi->transfer(0x00); // read out the register value
|
||||
|
||||
CS_HIGH();
|
||||
_spi->endTransaction();
|
||||
delay(100);
|
||||
|
||||
return regValue;
|
||||
}
|
||||
|
||||
@@ -592,6 +579,7 @@ long ADS1256::readSingleContinuous() // Reads the recently selected input channe
|
||||
{
|
||||
if (m_isAcquisitionRunning == false)
|
||||
{
|
||||
enableDRDYinterrupt();
|
||||
m_isAcquisitionRunning = true;
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1));
|
||||
CS_LOW(); // REF: P34: "CS must stay low during the entire command sequence"
|
||||
@@ -620,6 +608,7 @@ long ADS1256::cycleSingle()
|
||||
{
|
||||
if (m_isAcquisitionRunning == false)
|
||||
{
|
||||
enableDRDYinterrupt();
|
||||
m_isAcquisitionRunning = true;
|
||||
m_cycle = 0;
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1));
|
||||
@@ -629,9 +618,6 @@ long ADS1256::cycleSingle()
|
||||
_spi->transfer(SING_0); // AIN0+AINCOM
|
||||
delayMicroseconds(250);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
if (m_cycle < 8)
|
||||
{
|
||||
@@ -704,20 +690,16 @@ long ADS1256::cycleDifferential()
|
||||
{
|
||||
if (m_isAcquisitionRunning == false)
|
||||
{
|
||||
enableDRDYinterrupt();
|
||||
m_cycle = 0;
|
||||
m_isAcquisitionRunning = true;
|
||||
_spi->beginTransaction(SPISettings(SPI_FREQ, MSBFIRST, SPI_MODE1));
|
||||
|
||||
// Set the AIN0+AIN1 as inputs manually
|
||||
CS_LOW(); // CS must stay LOW during the entire sequence [Ref: P34, T24]
|
||||
_spi->transfer(WREG | MUX_REG); // 0x50 = WREG //1 = MUX
|
||||
_spi->transfer(0x00);
|
||||
_spi->transfer(DIFF_0_1); // AIN0+AIN1
|
||||
_spi->transfer(DIFF_0_1); // Set the AIN0+AIN1 as inputs manually
|
||||
delayMicroseconds(250);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
if (m_cycle < 4)
|
||||
{
|
||||
@@ -798,4 +780,36 @@ inline void ADS1256::CS_HIGH()
|
||||
{
|
||||
digitalWrite(m_CS_pin, HIGH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// functions for callback
|
||||
inline uint8_t ADS1256::getDRDYpin()
|
||||
{
|
||||
return m_DRDY_pin;
|
||||
}
|
||||
|
||||
inline SemaphoreHandle_t ADS1256::getDRDYsemaphoreHigh()
|
||||
{
|
||||
return m_drdyHigh;
|
||||
}
|
||||
|
||||
inline SemaphoreHandle_t ADS1256::getDRDYsemaphoreLow()
|
||||
{
|
||||
return m_drdyLow;
|
||||
}
|
||||
|
||||
inline void ADS1256::enableDRDYinterrupt()
|
||||
{
|
||||
// release semaphores to avoid deadlock
|
||||
xSemaphoreGive(m_drdyHigh);
|
||||
xSemaphoreGive(m_drdyLow);
|
||||
enableInterrupt(m_DRDY_pin);
|
||||
}
|
||||
|
||||
inline void ADS1256::disableDRDYinterrupt()
|
||||
{
|
||||
// release semaphores to avoid deadlock
|
||||
disableInterrupt(m_DRDY_pin);
|
||||
xSemaphoreGive(m_drdyHigh);
|
||||
xSemaphoreGive(m_drdyLow);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
Benjamin Pelletier for pointing out and fixing an issue around the handling of the DRDY signal
|
||||
*/
|
||||
|
||||
#ifndef _ADS1256_h
|
||||
#define _ADS1256_h
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Arduino.h>
|
||||
@@ -159,21 +158,10 @@ public:
|
||||
// Stop AD
|
||||
void stopConversion();
|
||||
|
||||
// functions for callback
|
||||
inline uint8_t getDRDYpin()
|
||||
{
|
||||
return m_DRDY_pin;
|
||||
}
|
||||
|
||||
SemaphoreHandle_t getDRDYsemaphoreHigh()
|
||||
{
|
||||
return m_drdyHigh;
|
||||
}
|
||||
|
||||
SemaphoreHandle_t getDRDYsemaphoreLow()
|
||||
{
|
||||
return m_drdyLow;
|
||||
}
|
||||
// functions for callback, public to be accessed by static callback
|
||||
inline uint8_t getDRDYpin();
|
||||
inline SemaphoreHandle_t getDRDYsemaphoreHigh();
|
||||
inline SemaphoreHandle_t getDRDYsemaphoreLow();
|
||||
|
||||
private:
|
||||
SPIClass *_spi; // Pointer to an SPIClass object
|
||||
@@ -183,6 +171,8 @@ private:
|
||||
void updateMUX(uint8_t muxValue);
|
||||
inline void CS_LOW();
|
||||
inline void CS_HIGH();
|
||||
inline void enableDRDYinterrupt();
|
||||
inline void disableDRDYinterrupt();
|
||||
|
||||
void updateConversionParameter(); // Refresh the conversion parameter based on the PGA
|
||||
|
||||
@@ -212,4 +202,3 @@ private:
|
||||
SemaphoreHandle_t m_drdyHigh;
|
||||
SemaphoreHandle_t m_drdyLow;
|
||||
};
|
||||
#endif
|
||||
@@ -21,9 +21,9 @@ lib_deps =
|
||||
me-no-dev/AsyncTCP@^3.3.2
|
||||
me-no-dev/ESPAsyncWebServer@^3.6.0
|
||||
upload_protocol = esptool
|
||||
upload_port = /dev/ttyACM1
|
||||
upload_port = /dev/ttyACM0
|
||||
upload_speed = 921600
|
||||
monitor_port = /dev/ttyACM0
|
||||
monitor_port = /dev/ttyACM1
|
||||
monitor_speed = 921600
|
||||
build_type = release
|
||||
build_flags =
|
||||
@@ -35,6 +35,7 @@ build_flags =
|
||||
-DCONFIG_ASYNC_TCP_QUEUE_SIZE=64
|
||||
-DCONFIG_ASYNC_TCP_RUNNING_CORE=1
|
||||
-DCONFIG_ASYNC_TCP_STACK_SIZE=4096
|
||||
-fstack-protector-strong
|
||||
|
||||
[env:esp32-s3-devkitc1-n16r8-debug]
|
||||
board = ${env:esp32-s3-devkitc1-n16r8.board}
|
||||
@@ -45,9 +46,9 @@ framework = ${env:esp32-s3-devkitc1-n16r8.framework}
|
||||
lib_deps =
|
||||
${env:esp32-s3-devkitc1-n16r8.lib_deps}
|
||||
upload_protocol = esptool
|
||||
upload_port = /dev/ttyACM1
|
||||
upload_port = /dev/ttyACM0
|
||||
upload_speed = 921600
|
||||
monitor_port = /dev/ttyACM0
|
||||
monitor_port = /dev/ttyACM1
|
||||
monitor_speed = 921600
|
||||
debug_tool = esp-builtin
|
||||
debug_speed = 15000
|
||||
|
||||
@@ -48,28 +48,28 @@ void ignitionBoxStatusFiltered::update(const ignitionBoxStatus &new_status)
|
||||
m_count++;
|
||||
// simple moving average calculation
|
||||
m_last.timestamp = new_status.timestamp; // keep timestamp of latest status
|
||||
m_last.coils12.n_events = new_status.coils12.n_events; // sum events instead of averaging
|
||||
m_last.coils12.n_missed_firing = new_status.coils12.n_missed_firing; // sum missed firings instead of averaging
|
||||
m_last.coils12.spark_status = new_status.coils12.spark_status; // take latest spark status
|
||||
m_last.coils12.sstart_status = new_status.coils12.sstart_status; // take latest soft start status
|
||||
filter(m_last.coils12.spark_delay, new_status.coils12.spark_delay, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peak_p_in, new_status.coils12.peak_p_in, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peak_n_in, new_status.coils12.peak_n_in, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peak_p_out, new_status.coils12.peak_p_out, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peak_n_out, new_status.coils12.peak_n_out, m_max_count); // incremental average calculation
|
||||
m_last.coils12.nEvents = new_status.coils12.nEvents; // sum events instead of averaging
|
||||
m_last.coils12.nMissedFiring = new_status.coils12.nMissedFiring; // sum missed firings instead of averaging
|
||||
m_last.coils12.sparkStatus = new_status.coils12.sparkStatus; // take latest spark status
|
||||
m_last.coils12.softStartStatus = new_status.coils12.softStartStatus; // take latest soft start status
|
||||
filter(m_last.coils12.sparkDelay, new_status.coils12.sparkDelay, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peakPos, new_status.coils12.peakPos, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.peakNeg, new_status.coils12.peakNeg, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.trigLevelPos, new_status.coils12.trigLevelPos, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils12.trigLevelNeg, new_status.coils12.trigLevelNeg, m_max_count); // incremental average calculation
|
||||
|
||||
m_last.coils34.n_events = new_status.coils34.n_events; // sum events instead of averaging
|
||||
m_last.coils34.n_missed_firing = new_status.coils34.n_missed_firing; // sum missed firings instead of averaging
|
||||
m_last.coils34.spark_status = new_status.coils34.spark_status; // take latest spark status
|
||||
m_last.coils34.sstart_status = new_status.coils34.sstart_status; // take latest soft start status
|
||||
filter(m_last.coils34.spark_delay, new_status.coils34.spark_delay, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peak_p_in, new_status.coils34.peak_p_in, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peak_n_in, new_status.coils34.peak_n_in, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peak_p_out, new_status.coils34.peak_p_out, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peak_n_out, new_status.coils34.peak_n_out, m_max_count); // incremental average calculation
|
||||
filter(m_last.eng_rpm, new_status.eng_rpm, m_max_count); // incremental average calculation // incremental average calculation
|
||||
filter(m_last.adc_read_time, m_last.adc_read_time, m_max_count); // incremental average calculation
|
||||
m_last.n_queue_errors = new_status.n_queue_errors;
|
||||
m_last.coils34.nEvents = new_status.coils34.nEvents; // sum events instead of averaging
|
||||
m_last.coils34.nMissedFiring = new_status.coils34.nMissedFiring; // sum missed firings instead of averaging
|
||||
m_last.coils34.sparkStatus = new_status.coils34.sparkStatus; // take latest spark status
|
||||
m_last.coils34.softStartStatus = new_status.coils34.softStartStatus; // take latest soft start status
|
||||
filter(m_last.coils34.sparkDelay, new_status.coils34.sparkDelay, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peakPos, new_status.coils34.peakPos, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.peakNeg, new_status.coils34.peakNeg, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.trigLevelPos, new_status.coils34.trigLevelPos, m_max_count); // incremental average calculation
|
||||
filter(m_last.coils34.trigLevelNeg, new_status.coils34.trigLevelNeg, m_max_count); // incremental average calculation
|
||||
filter(m_last.engRpm, new_status.engRpm, m_max_count); // incremental average calculation // incremental average calculation
|
||||
filter(m_last.adcReadTime, m_last.adcReadTime, m_max_count); // incremental average calculation
|
||||
m_last.nQueueErrors = new_status.nQueueErrors;
|
||||
|
||||
if (m_count >= m_max_count)
|
||||
{
|
||||
@@ -95,29 +95,29 @@ const ArduinoJson::JsonDocument ignitionBoxStatusFiltered::toJson() const
|
||||
doc["timestamp"] = m_last.timestamp;
|
||||
doc["datavalid"] = m_data_valid ? "TRUE" : "FALSE";
|
||||
|
||||
doc["coils12"]["n_events"] = m_last.coils12.n_events;
|
||||
doc["coils12"]["n_missed_firing"] = m_last.coils12.n_missed_firing;
|
||||
doc["coils12"]["spark_delay"] = m_last.coils12.spark_delay;
|
||||
doc["coils12"]["spark_status"] = sparkStatusNames.at(m_last.coils12.spark_status);
|
||||
doc["coils12"]["peak_p_in"] = m_last.coils12.peak_p_in;
|
||||
doc["coils12"]["peak_n_in"] = m_last.coils12.peak_n_in;
|
||||
doc["coils12"]["peak_p_out"] = m_last.coils12.peak_p_out;
|
||||
doc["coils12"]["peak_n_out"] = m_last.coils12.peak_n_out;
|
||||
doc["coils12"]["sstart_status"] = softStartStatusNames.at(m_last.coils12.sstart_status);
|
||||
doc["coils12"]["nEvents"] = m_last.coils12.nEvents;
|
||||
doc["coils12"]["nMissedFiring"] = m_last.coils12.nMissedFiring;
|
||||
doc["coils12"]["sparkDelay"] = m_last.coils12.sparkDelay;
|
||||
doc["coils12"]["sparkStatus"] = sparkStatusNames.at(m_last.coils12.sparkStatus);
|
||||
doc["coils12"]["peakPos"] = m_last.coils12.peakPos;
|
||||
doc["coils12"]["peakNeg"] = m_last.coils12.peakNeg;
|
||||
doc["coils12"]["trigLevelPos"] = m_last.coils12.trigLevelPos;
|
||||
doc["coils12"]["trigLevelNeg"] = m_last.coils12.trigLevelNeg;
|
||||
doc["coils12"]["softStartStatus"] = softStartStatusNames.at(m_last.coils12.softStartStatus);
|
||||
|
||||
doc["coils34"]["n_events"] = m_last.coils34.n_events;
|
||||
doc["coils34"]["n_missed_firing"] = m_last.coils34.n_missed_firing;
|
||||
doc["coils34"]["spark_delay"] = m_last.coils34.spark_delay;
|
||||
doc["coils34"]["spark_status"] = sparkStatusNames.at(m_last.coils34.spark_status);
|
||||
doc["coils34"]["peak_p_in"] = m_last.coils34.peak_p_in;
|
||||
doc["coils34"]["peak_n_in"] = m_last.coils34.peak_n_in;
|
||||
doc["coils34"]["peak_p_out"] = m_last.coils34.peak_p_out;
|
||||
doc["coils34"]["peak_n_out"] = m_last.coils34.peak_n_out;
|
||||
doc["coils34"]["sstart_status"] = softStartStatusNames.at(m_last.coils34.sstart_status);
|
||||
doc["coils34"]["nEvents"] = m_last.coils34.nEvents;
|
||||
doc["coils34"]["nMissedFiring"] = m_last.coils34.nMissedFiring;
|
||||
doc["coils34"]["sparkDelay"] = m_last.coils34.sparkDelay;
|
||||
doc["coils34"]["sparkStatus"] = sparkStatusNames.at(m_last.coils34.sparkStatus);
|
||||
doc["coils34"]["peakPos"] = m_last.coils34.peakPos;
|
||||
doc["coils34"]["peakNeg"] = m_last.coils34.peakNeg;
|
||||
doc["coils34"]["trigLevelPos"] = m_last.coils34.trigLevelPos;
|
||||
doc["coils34"]["trigLevelNeg"] = m_last.coils34.trigLevelNeg;
|
||||
doc["coils34"]["softStartStatus"] = softStartStatusNames.at(m_last.coils34.softStartStatus);
|
||||
|
||||
doc["eng_rpm"] = m_last.eng_rpm;
|
||||
doc["adc_read_time"] = m_last.adc_read_time;
|
||||
doc["n_queue_errors"] = m_last.n_queue_errors;
|
||||
doc["engRpm"] = m_last.engRpm;
|
||||
doc["adcReadTime"] = m_last.adcReadTime;
|
||||
doc["nQueueErrors"] = m_last.nQueueErrors;
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ static const uint32_t SPARK_FLAG_12 = (1 << 9);
|
||||
static const uint32_t SPARK_FLAG_34 = (1 << 10);
|
||||
|
||||
// Spark Status
|
||||
enum sparkStatus
|
||||
enum sparkStatusEnum
|
||||
{
|
||||
SPARK_POS_OK,
|
||||
SPARK_NEG_OK,
|
||||
@@ -31,7 +31,7 @@ enum sparkStatus
|
||||
SPARK_SYNC_FAIL,
|
||||
};
|
||||
|
||||
static const std::map<const sparkStatus, const char *> sparkStatusNames = {
|
||||
static const std::map<const sparkStatusEnum, const char *> sparkStatusNames = {
|
||||
{SPARK_POS_OK, "SPARK_POS_OK"},
|
||||
{SPARK_NEG_OK, "SPARK_NEG_OK"},
|
||||
{SPARK_POS_SKIP, "SPARK_POS_SKIP"},
|
||||
@@ -45,14 +45,14 @@ static const std::map<const sparkStatus, const char *> sparkStatusNames = {
|
||||
{SPARK_SYNC_FAIL, "SPARK_SYNC_FAIL"},
|
||||
};
|
||||
|
||||
enum softStartStatus
|
||||
enum softStartStatusEnum
|
||||
{
|
||||
NORMAL,
|
||||
SOFT_START,
|
||||
ERROR,
|
||||
};
|
||||
|
||||
const std::map<const softStartStatus, const char *> softStartStatusNames = {
|
||||
const std::map<const softStartStatusEnum, const char *> softStartStatusNames = {
|
||||
{NORMAL, "NORMAL"},
|
||||
{SOFT_START, "SOFT_START"},
|
||||
{ERROR, "ERROR"},
|
||||
@@ -60,18 +60,17 @@ const std::map<const softStartStatus, const char *> softStartStatusNames = {
|
||||
|
||||
struct coilsStatus
|
||||
{
|
||||
int64_t trig_time = 0;
|
||||
int64_t spark_time = 0;
|
||||
int32_t spark_delay = 0; // in microseconds
|
||||
sparkStatus spark_status = sparkStatus::SPARK_POS_OK;
|
||||
softStartStatus sstart_status = softStartStatus::NORMAL;
|
||||
float peak_p_in = 0.0;
|
||||
float peak_n_in = 0.0;
|
||||
float peak_p_out = 0.0;
|
||||
float peak_n_out = 0.0;
|
||||
float level_spark = 0.0;
|
||||
uint32_t n_events = 0;
|
||||
uint32_t n_missed_firing = 0;
|
||||
int64_t coilTime = 0;
|
||||
int64_t sparkTime = 0;
|
||||
int32_t sparkDelay = 0; // in microseconds
|
||||
sparkStatusEnum sparkStatus = sparkStatusEnum::SPARK_POS_OK;
|
||||
softStartStatusEnum softStartStatus = softStartStatusEnum::NORMAL;
|
||||
float peakPos = 0.0;
|
||||
float peakNeg = 0.0;
|
||||
float trigLevelPos = 0.0;
|
||||
float trigLevelNeg = 0.0;
|
||||
uint32_t nEvents = 0;
|
||||
uint32_t nMissedFiring = 0;
|
||||
};
|
||||
|
||||
// Task internal Status
|
||||
@@ -81,13 +80,12 @@ struct ignitionBoxStatus
|
||||
// coils pairs for each ignition
|
||||
coilsStatus coils12;
|
||||
coilsStatus coils34;
|
||||
// voltage from generator
|
||||
float volts_gen = 0.0;
|
||||
// enine rpm
|
||||
int32_t eng_rpm = 0;
|
||||
int32_t engRpm = 0;
|
||||
// debug values
|
||||
uint32_t n_queue_errors = 0;
|
||||
int32_t adc_read_time = 0;
|
||||
uint32_t nQueueErrors = 0;
|
||||
int32_t adcReadTime = 0;
|
||||
int32_t ioReadWriteTime = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -26,22 +26,22 @@ void trig_isr_A(void *arg)
|
||||
case TRIG_FLAG_12P:
|
||||
case TRIG_FLAG_12N:
|
||||
// only on first trigger to avoid multiple firing due to noise, to be fixed with hardware debounce
|
||||
box->coils12.trig_time = time_us;
|
||||
box->coils12.coilTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case TRIG_FLAG_34P:
|
||||
case TRIG_FLAG_34N:
|
||||
// only on first trigger to avoid multiple firing due to noise, to be fixed with hardware debounce
|
||||
box->coils34.trig_time = time_us;
|
||||
box->coils34.coilTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case SPARK_FLAG_12:
|
||||
|
||||
box->coils12.spark_time = time_us;
|
||||
box->coils12.sparkTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case SPARK_FLAG_34:
|
||||
box->coils34.spark_time = time_us;
|
||||
box->coils34.sparkTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
default:
|
||||
@@ -75,22 +75,22 @@ void trig_isr_B(void *arg)
|
||||
case TRIG_FLAG_12P:
|
||||
case TRIG_FLAG_12N:
|
||||
// only on first trigger to avoid multiple firing due to noise, to be fixed with hardware debounce
|
||||
box->coils12.trig_time = time_us;
|
||||
box->coils12.coilTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case TRIG_FLAG_34P:
|
||||
case TRIG_FLAG_34N:
|
||||
// only on first trigger to avoid multiple firing due to noise, to be fixed with hardware debounce
|
||||
box->coils34.trig_time = time_us;
|
||||
box->coils34.coilTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case SPARK_FLAG_12:
|
||||
|
||||
box->coils12.spark_time = time_us;
|
||||
box->coils12.sparkTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
case SPARK_FLAG_34:
|
||||
box->coils34.spark_time = time_us;
|
||||
box->coils34.sparkTime = time_us;
|
||||
xTaskNotifyFromISR(task_handle, params->flag, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Test device Flag
|
||||
// #define TEST
|
||||
|
||||
// Arduino Libraries
|
||||
#include <Arduino.h>
|
||||
#include "soc/gpio_struct.h"
|
||||
#include <map>
|
||||
#ifndef TEST
|
||||
|
||||
#include "pins.h"
|
||||
#else
|
||||
#include "pins_test.h"
|
||||
#endif
|
||||
#include "datastruct.h"
|
||||
|
||||
#define CORE_0 0
|
||||
|
||||
+57
-25
@@ -16,11 +16,11 @@
|
||||
#include <ui.h>
|
||||
#include <led.h>
|
||||
|
||||
//#define CH_A_ENABLE
|
||||
//#define CH_B_ENABLE
|
||||
// #define CH_A_ENABLE
|
||||
// #define CH_B_ENABLE
|
||||
#define CH_A_RT_ENABLE
|
||||
#define CH_B_RT_ENABLE
|
||||
//#define I2C_ENABLE
|
||||
// #define I2C_ENABLE
|
||||
#define WEB_ENABLE
|
||||
|
||||
// Debug Defines
|
||||
@@ -28,6 +28,7 @@
|
||||
#define WIFI_PASSWORD "maledettirotax"
|
||||
#define PSRAM_MAX 4096
|
||||
#define QUEUE_MAX 128
|
||||
#define HTOP_DELAY 2000
|
||||
|
||||
void setup()
|
||||
{
|
||||
@@ -172,13 +173,13 @@ void loop()
|
||||
.rt_stack_size = RT_TASK_STACK,
|
||||
.rt_priority = RT_TASK_PRIORITY,
|
||||
.rt_int = rtIgnitionTask::rtTaskInterruptParams{
|
||||
.isr_ptr = &trig_isr_A,
|
||||
.trig_pin_12p = TRIG_PIN_A12P,
|
||||
.trig_pin_12n = TRIG_PIN_A12N,
|
||||
.trig_pin_34p = TRIG_PIN_A34P,
|
||||
.trig_pin_34n = TRIG_PIN_A34N,
|
||||
.spark_pin_12 = SPARK_PIN_A12,
|
||||
.spark_pin_34 = SPARK_PIN_A34},
|
||||
.isrPtr = &trig_isr_A,
|
||||
.trigPin_12p = TRIG_PIN_A12P,
|
||||
.trigPin_12n = TRIG_PIN_A12N,
|
||||
.trigPin_34p = TRIG_PIN_A34P,
|
||||
.trigPin_34n = TRIG_PIN_A34N,
|
||||
.sparkPin_12 = SPARK_PIN_A12,
|
||||
.sparkPin_34 = SPARK_PIN_A34},
|
||||
.rt_io = rtIgnitionTask::rtTaskIOParams{
|
||||
.pot_cs_12 = POT_CS_A12,
|
||||
.pot_cs_34 = POT_CS_A34,
|
||||
@@ -204,13 +205,13 @@ void loop()
|
||||
.rt_stack_size = RT_TASK_STACK,
|
||||
.rt_priority = RT_TASK_PRIORITY,
|
||||
.rt_int = rtIgnitionTask::rtTaskInterruptParams{
|
||||
.isr_ptr = &trig_isr_B,
|
||||
.trig_pin_12p = TRIG_PIN_B12P,
|
||||
.trig_pin_12n = TRIG_PIN_B12N,
|
||||
.trig_pin_34p = TRIG_PIN_B34P,
|
||||
.trig_pin_34n = TRIG_PIN_B34N,
|
||||
.spark_pin_12 = SPARK_PIN_B12,
|
||||
.spark_pin_34 = SPARK_PIN_B34},
|
||||
.isrPtr = &trig_isr_B,
|
||||
.trigPin_12p = TRIG_PIN_B12P,
|
||||
.trigPin_12n = TRIG_PIN_B12N,
|
||||
.trigPin_34p = TRIG_PIN_B34P,
|
||||
.trigPin_34n = TRIG_PIN_B34N,
|
||||
.sparkPin_12 = SPARK_PIN_B12,
|
||||
.sparkPin_34 = SPARK_PIN_B34},
|
||||
.rt_io = rtIgnitionTask::rtTaskIOParams{
|
||||
.pot_cs_12 = POT_CS_B12,
|
||||
.pot_cs_34 = POT_CS_B34,
|
||||
@@ -276,21 +277,52 @@ void loop()
|
||||
AstroWebServer webPage(80, LittleFS);
|
||||
delay(100);
|
||||
|
||||
#ifdef CH_A_RT_ENABLE
|
||||
task_A.onMessage([&webPage, &json_data, &data_a](ignitionBoxStatusFiltered sts)
|
||||
{
|
||||
json_data["box_a"] = sts.toJson();
|
||||
data_a = true; });
|
||||
#endif
|
||||
|
||||
#ifdef CH_B_RT_ENABLE
|
||||
#ifdef CH_B_RT_ENABLE
|
||||
task_B.onMessage([&webPage, &json_data, &data_b](ignitionBoxStatusFiltered sts)
|
||||
{
|
||||
json_data["box_b"] = sts.toJson();
|
||||
data_b = true; });
|
||||
#endif
|
||||
#endif
|
||||
|
||||
task_A.enableSave(true, "ignitionA_test.csv");
|
||||
task_B.enableSave(true, "ignitionB_test.csv");
|
||||
webPage.registerWsCommand("saveEnable", [&task_A, &task_B](const ArduinoJson::JsonDocument &doc) {
|
||||
if(!doc["params"].is<ArduinoJson::JsonObject>()) return;
|
||||
if(!doc["filename_a"].is<std::string>() ||!doc["filename_b"].is<std::string>()){
|
||||
LOG_ERROR("saveEnable invalid or missing filenames");
|
||||
return;
|
||||
}
|
||||
|
||||
task_A.enableSave(true, doc["filename_a"].as<std::string>());
|
||||
task_B.enableSave(true, doc["filename_a"].as<std::string>());
|
||||
return; });
|
||||
|
||||
webPage.registerWsCommand("saveDisable", [&task_A, &task_B](const ArduinoJson::JsonDocument &doc) {
|
||||
task_A.enableSave(false, "");
|
||||
task_B.enableSave(false, ""); });
|
||||
|
||||
webPage.registerWsCommand("downloadHistory", [](const ArduinoJson::JsonDocument &doc) {
|
||||
LOG_WARN("Command downloadHistory not Implemented");
|
||||
});
|
||||
|
||||
webPage.registerWsCommand("clearHistory", [](const ArduinoJson::JsonDocument &doc) {
|
||||
LOG_WARN("Command clearHistory not Implemented");
|
||||
});
|
||||
|
||||
webPage.registerWsCommand("startTest", [](const ArduinoJson::JsonDocument &doc) {
|
||||
LOG_WARN("Command startTest not Implemented");
|
||||
});
|
||||
|
||||
webPage.registerWsCommand("stopTest", [](const ArduinoJson::JsonDocument &doc) {
|
||||
LOG_WARN("Command stopTest not Implemented");
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
uint32_t monitor_loop = millis();
|
||||
uint32_t data_loop = monitor_loop;
|
||||
@@ -298,21 +330,21 @@ void loop()
|
||||
while (running)
|
||||
{
|
||||
uint32_t this_loop = millis();
|
||||
if (this_loop - monitor_loop > 5000)
|
||||
if (this_loop - monitor_loop > HTOP_DELAY)
|
||||
{
|
||||
clearScreen();
|
||||
printRunningTasksMod(Serial);
|
||||
monitor_loop = millis();
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
#ifdef WEB_ENABLE
|
||||
if ((data_a && data_b) || (this_loop - data_loop > 500))
|
||||
#ifdef WEB_ENABLE
|
||||
if ((data_a && data_b) || ((this_loop - data_loop > 500) && (data_b || data_b)))
|
||||
{
|
||||
webPage.sendWsData(json_data.as<String>());
|
||||
json_data.clear();
|
||||
data_a = data_b = false;
|
||||
data_loop = millis();
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
#endif
|
||||
} //////////////// INNER LOOP /////////////////////
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
// I2C BUS (PCA9555)
|
||||
// =====================
|
||||
#define SDA 21
|
||||
#define SCL 38
|
||||
#define SCL 47
|
||||
|
||||
// =====================
|
||||
// ADC CONTROL
|
||||
@@ -50,7 +50,7 @@
|
||||
#define ADC_A_DRDY 13
|
||||
|
||||
#define ADC_B_CS 3
|
||||
#define ADC_B_DRDY 9
|
||||
#define ADC_B_DRDY 46
|
||||
|
||||
// =====================
|
||||
// TRIGGER INPUT INTERRUPTS
|
||||
@@ -85,7 +85,7 @@
|
||||
// =====================
|
||||
// PCA9555 I/O EXPANDER BOX_A (OUT)
|
||||
// =====================
|
||||
#define EXPANDER_A_OUT_ADDR 0xFF
|
||||
#define EXPANDER_A_OUT_ADDR 0x7F
|
||||
|
||||
// --- DIGITAL POT CHIP SELECT LINES ---
|
||||
#define POT_CS_A12 PIN2ADDR(0, EXPANDER_A_OUT_ADDR)
|
||||
@@ -111,7 +111,7 @@
|
||||
// =====================
|
||||
// PCA9555 I/O EXPANDER BOX_A (IN)
|
||||
// =====================
|
||||
#define EXPANDER_A_IN_ADDR 0xFF
|
||||
#define EXPANDER_A_IN_ADDR 0x7F
|
||||
|
||||
#define SS_A12_ON PIN2ADDR(0, EXPANDER_A_IN_ADDR)
|
||||
#define SS_A12_OFF PIN2ADDR(1, EXPANDER_A_IN_ADDR)
|
||||
@@ -121,7 +121,7 @@
|
||||
// =====================
|
||||
// PCA9555 I/O EXPANDER BOX_B (OUT)
|
||||
// =====================
|
||||
#define EXPANDER_B_OUT_ADDR 0xFF
|
||||
#define EXPANDER_B_OUT_ADDR 0x7F
|
||||
|
||||
// --- DIGITAL POT CHIP SELECT LINES ---
|
||||
#define POT_CS_B12 PIN2ADDR(0, EXPANDER_B_OUT_ADDR)
|
||||
@@ -147,7 +147,7 @@
|
||||
// =====================
|
||||
// PCA9555 I/O EXPANDER BOX_B (IN)
|
||||
// =====================
|
||||
#define EXPANDER_B_IN_ADDR 0xFF
|
||||
#define EXPANDER_B_IN_ADDR 0x7F
|
||||
|
||||
#define SS_B12_ON PIN2ADDR(0, EXPANDER_B_IN_ADDR)
|
||||
#define SS_B12_OFF PIN2ADDR(1, EXPANDER_B_IN_ADDR)
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
// =====================
|
||||
// UART DEBUG
|
||||
// =====================
|
||||
#define UART_TX 1 // TX0 (USB seriale)
|
||||
#define UART_RX 3 // RX0
|
||||
|
||||
|
||||
// =====================
|
||||
// SPI BUS
|
||||
// =====================
|
||||
#define SPI_A_MOSI 23
|
||||
#define SPI_A_MISO 19
|
||||
#define SPI_A_SCK 18
|
||||
|
||||
|
||||
// =====================
|
||||
// I2C BUS
|
||||
// =====================
|
||||
#define SDA 21
|
||||
#define SCL 22
|
||||
|
||||
|
||||
// =====================
|
||||
// ADC CONTROL (SPI + interrupt safe)
|
||||
// =====================
|
||||
#define ADC_A_CS 5 // chip select
|
||||
#define ADC_A_DRDY 34 // input only + interrupt perfetto
|
||||
#define ADC_A_RST 27 // output
|
||||
#define ADC_A_SYNC 26 // output
|
||||
|
||||
|
||||
// =====================
|
||||
// DIGITAL OUT
|
||||
// =====================
|
||||
#define POT_A_CS 25
|
||||
#define POT_B_CS 33
|
||||
|
||||
|
||||
// =====================
|
||||
// TRIGGER INPUT INTERRUPTS
|
||||
// =====================
|
||||
#define TRIG_PIN_A12P 35
|
||||
#define TRIG_PIN_A12N 32
|
||||
#define TRIG_PIN_A34P 39
|
||||
#define TRIG_PIN_A34N 36
|
||||
|
||||
|
||||
// =====================
|
||||
// SPARK DETECT INTERRUPTS
|
||||
// =====================
|
||||
#define SPARK_PIN_A12 4
|
||||
#define SPARK_PIN_A34 2
|
||||
|
||||
// =====================
|
||||
// PCA9555 (I2C EXPANDER)
|
||||
// =====================
|
||||
|
||||
// --- RESET LINES ---
|
||||
#define RST_EXT_A12P 0
|
||||
#define RST_EXT_A12N 1
|
||||
#define RST_EXT_A34P 2
|
||||
#define RST_EXT_A34N 3
|
||||
|
||||
// --- RELAY ---
|
||||
#define SH_ARM_A34 8
|
||||
|
||||
|
||||
// Init Pin Functions
|
||||
inline void initTriggerPinsInputs()
|
||||
{
|
||||
pinMode(TRIG_PIN_A12P, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_PIN_A12N, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_PIN_A34P, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_PIN_A34N, INPUT_PULLDOWN);
|
||||
}
|
||||
|
||||
inline void initSparkPinInputs()
|
||||
{
|
||||
pinMode(SPARK_PIN_A12, INPUT_PULLDOWN);
|
||||
pinMode(SPARK_PIN_A34, INPUT_PULLDOWN);
|
||||
}
|
||||
+230
-208
@@ -37,155 +37,156 @@ void rtIgnitionTask::rtIgnitionTask_realtime(void *pvParameters)
|
||||
}
|
||||
|
||||
// Task Parameters and Devices
|
||||
rtTaskParams *params = (rtTaskParams *)pvParameters;
|
||||
const rtTaskInterruptParams rt_int = params->rt_int; // copy to avoid external override
|
||||
const rtTaskIOParams rt_rst = params->rt_io; // copy to avoid external override
|
||||
QueueHandle_t rt_queue = params->rt_queue;
|
||||
const rtTaskParams *params = (const rtTaskParams *)pvParameters;
|
||||
const rtTaskInterruptParams rtInterrupts = params->rt_int; // copy to avoid external override
|
||||
const rtTaskIOParams rtResets = params->rt_io; // copy to avoid external override
|
||||
QueueHandle_t rtQueue = params->rt_queue;
|
||||
Devices *dev = params->dev;
|
||||
ExternalIO *io = dev->m_ext_io;
|
||||
ADS1256 *adc = params->name == "rtIgnTask_A" ? dev->m_adc_a : dev->m_adc_b;
|
||||
std::mutex &spi_mutex = params->name == "rtIgnTask_A" ? dev->m_spi_a_mutex : dev->m_spi_b_mutex;
|
||||
|
||||
TaskStatus_t rt_task_info;
|
||||
vTaskGetInfo(NULL, &rt_task_info, pdFALSE, eInvalid);
|
||||
|
||||
// Geta task name and additiona info for debug messages
|
||||
TaskStatus_t rtTaskInfo;
|
||||
vTaskGetInfo(NULL, &rtTaskInfo, pdFALSE, eInvalid);
|
||||
LOG_INFO("rtTask Params OK [", params->name.c_str(), "]");
|
||||
|
||||
ignitionBoxStatus ign_box_sts;
|
||||
// Status of ignition box for this task, to be used locally and passed to isr to get timing
|
||||
ignitionBoxStatus ignBoxStatus;
|
||||
|
||||
// Variables for ISR, static to be fixed in memory locations
|
||||
isrParams isr_params_t12p{
|
||||
isrParams isrParams_t12p{
|
||||
.flag = TRIG_FLAG_12P,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
isrParams isr_params_t12n{
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
isrParams isrParams_t12n{
|
||||
.flag = TRIG_FLAG_12N,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
isrParams isr_params_t34p{
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
isrParams isrParams_t34p{
|
||||
.flag = TRIG_FLAG_34P,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
isrParams isr_params_t34n{
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
isrParams isrParams_t34n{
|
||||
.flag = TRIG_FLAG_34N,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
isrParams isr_params_sp12{
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
isrParams isrParams_sp12{
|
||||
.flag = SPARK_FLAG_12,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
isrParams isr_params_sp34{
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
isrParams isrParams_sp34{
|
||||
.flag = SPARK_FLAG_34,
|
||||
.ign_stat = &ign_box_sts,
|
||||
.rt_handle_ptr = rt_task_info.xHandle};
|
||||
.ign_stat = &ignBoxStatus,
|
||||
.rt_handle_ptr = rtTaskInfo.xHandle};
|
||||
|
||||
// Create esp_timer for microsecond precision timeout
|
||||
esp_timer_handle_t timeout_timer;
|
||||
esp_timer_create_args_t timer_args = {
|
||||
esp_timer_handle_t timeoutTimer;
|
||||
esp_timer_create_args_t timeoutTimerArgs = {
|
||||
.callback = spark_timeout_callback,
|
||||
.arg = (void *)rt_task_info.xHandle,
|
||||
.arg = (void *)rtTaskInfo.xHandle,
|
||||
.dispatch_method = ESP_TIMER_TASK,
|
||||
.name = "spark_timeout"};
|
||||
if (esp_timer_create(&timer_args, &timeout_timer) != ESP_OK)
|
||||
if (esp_timer_create(&timeoutTimerArgs, &timeoutTimer) != ESP_OK)
|
||||
{
|
||||
LOG_INFO("rtTask [", params->name.c_str(), "] Fail to allocate timeoutTimer");
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
// Attach Pin Interrupts
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.trig_pin_12p), rt_int.isr_ptr, (void *)&isr_params_t12p, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.trig_pin_12n), rt_int.isr_ptr, (void *)&isr_params_t12n, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.trig_pin_34p), rt_int.isr_ptr, (void *)&isr_params_t34p, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.trig_pin_34n), rt_int.isr_ptr, (void *)&isr_params_t34n, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.spark_pin_12), rt_int.isr_ptr, (void *)&isr_params_sp12, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rt_int.spark_pin_34), rt_int.isr_ptr, (void *)&isr_params_sp34, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.trigPin_12p), rtInterrupts.isrPtr, (void *)&isrParams_t12p, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.trigPin_12n), rtInterrupts.isrPtr, (void *)&isrParams_t12n, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.trigPin_34p), rtInterrupts.isrPtr, (void *)&isrParams_t34p, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.trigPin_34n), rtInterrupts.isrPtr, (void *)&isrParams_t34n, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.sparkPin_12), rtInterrupts.isrPtr, (void *)&isrParams_sp12, RISING);
|
||||
attachInterruptArg(digitalPinToInterrupt(rtInterrupts.sparkPin_34), rtInterrupts.isrPtr, (void *)&isrParams_sp34, RISING);
|
||||
|
||||
LOG_INFO("rtTask ISR Attach OK [", params->name.c_str(), "]");
|
||||
|
||||
// Global rt_task_ptr variables
|
||||
bool first_cycle = true;
|
||||
bool firstCycle = true;
|
||||
bool cycle12 = false;
|
||||
bool cycle34 = false;
|
||||
int64_t last_cycle_time = 0;
|
||||
uint32_t n_errors = 0;
|
||||
int64_t lastCycleTime = 0;
|
||||
uint32_t nErrors = 0;
|
||||
|
||||
while (params->rt_running)
|
||||
{
|
||||
uint32_t pickup_flag = 0;
|
||||
uint32_t spark_flag = 0;
|
||||
uint32_t pickupFlag = 0;
|
||||
uint32_t sparkFlag = 0;
|
||||
|
||||
// WAIT FOR PICKUP SIGNAL
|
||||
xTaskNotifyWait(
|
||||
0x00, // non pulire all'ingresso
|
||||
ULONG_MAX, // pulisci i primi 8 bit
|
||||
&pickup_flag, // valore ricevuto
|
||||
&pickupFlag, // valore ricevuto
|
||||
portMAX_DELAY);
|
||||
|
||||
if (first_cycle && pickup_flag != TRIG_FLAG_12P) // skip first cycle because of possible initial noise on pickup signals at startu
|
||||
if (firstCycle && pickupFlag != TRIG_FLAG_12P) // skip first cycle because of possible initial noise on pickup signals at startu
|
||||
continue;
|
||||
|
||||
// Start microsecond precision timeout timer
|
||||
esp_timer_stop(timeout_timer); // stop timer in case it was running from previous cycle
|
||||
esp_timer_start_once(timeout_timer, spark_timeout_max);
|
||||
esp_timer_stop(timeoutTimer); // stop timer in case it was running from previous cycle
|
||||
esp_timer_start_once(timeoutTimer, c_sparkTimeoutMax);
|
||||
|
||||
// WAIT FOR SPARK TO HAPPEN OR TIMEOUT
|
||||
xTaskNotifyWait(
|
||||
0x00, // non pulire all'ingresso
|
||||
ULONG_MAX, // pulisci i primi 8 bit
|
||||
&spark_flag, // valore ricevuto
|
||||
&sparkFlag, // valore ricevuto
|
||||
portMAX_DELAY); // wait indefinitely, timeout handled by esp_timer
|
||||
|
||||
// Handle timeout or spark event
|
||||
if (spark_flag != SPARK_FLAG_TIMEOUT)
|
||||
esp_timer_stop(timeout_timer);
|
||||
if (sparkFlag != SPARK_FLAG_TIMEOUT)
|
||||
esp_timer_stop(timeoutTimer);
|
||||
|
||||
// A trigger from pickup 12 is followed by a spark event on 34 or vice versa pickup 34 triggers spark on 12
|
||||
if ((pickup_flag == TRIG_FLAG_12P || pickup_flag == TRIG_FLAG_12N) && (spark_flag != SPARK_FLAG_12 && spark_flag != SPARK_FLAG_TIMEOUT))
|
||||
if ((pickupFlag == TRIG_FLAG_12P || pickupFlag == TRIG_FLAG_12N) && (sparkFlag != SPARK_FLAG_12 && sparkFlag != SPARK_FLAG_TIMEOUT))
|
||||
{
|
||||
ign_box_sts.coils12.spark_status = ign_box_sts.coils34.spark_status = sparkStatus::SPARK_SYNC_FAIL;
|
||||
ignBoxStatus.coils12.sparkStatus = ignBoxStatus.coils34.sparkStatus = sparkStatusEnum::SPARK_SYNC_FAIL;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Select coil status reference based on pickup_flag
|
||||
// Select coil status reference based on pickupFlag
|
||||
coilsStatus *coils;
|
||||
switch (pickup_flag)
|
||||
switch (pickupFlag)
|
||||
{
|
||||
case TRIG_FLAG_12P:
|
||||
{
|
||||
first_cycle = false;
|
||||
firstCycle = false;
|
||||
// compute engine rpm from cycle time
|
||||
auto current_time = esp_timer_get_time();
|
||||
auto cycle_time = current_time - last_cycle_time;
|
||||
last_cycle_time = current_time;
|
||||
ign_box_sts.eng_rpm = (int32_t)(60.0f / (cycle_time / 1000000.0f));
|
||||
auto currentTime = esp_timer_get_time();
|
||||
auto cycleTime = currentTime - lastCycleTime;
|
||||
lastCycleTime = currentTime;
|
||||
ignBoxStatus.engRpm = (int32_t)(60.0f / (cycleTime / 1000000.0f));
|
||||
}
|
||||
case TRIG_FLAG_12N:
|
||||
coils = &ign_box_sts.coils12;
|
||||
coils = &ignBoxStatus.coils12;
|
||||
break;
|
||||
case TRIG_FLAG_34P:
|
||||
case TRIG_FLAG_34N:
|
||||
coils = &ign_box_sts.coils34;
|
||||
coils = &ignBoxStatus.coils34;
|
||||
break;
|
||||
}
|
||||
|
||||
// Select logic based on pickup and spark flags
|
||||
switch (pickup_flag)
|
||||
switch (pickupFlag)
|
||||
{
|
||||
case TRIG_FLAG_12P:
|
||||
case TRIG_FLAG_34P:
|
||||
{
|
||||
// Timeout not occourred, expected POSITIVE edge spark OCCOURRED
|
||||
if (spark_flag != SPARK_FLAG_TIMEOUT)
|
||||
if (sparkFlag != SPARK_FLAG_TIMEOUT)
|
||||
{
|
||||
coils->spark_delay = (int32_t)(coils->spark_time - coils->trig_time);
|
||||
coils->sstart_status = softStartStatus::NORMAL; // because spark on positive edge
|
||||
coils->spark_status = sparkStatus::SPARK_POS_OK; // do not wait for spark on negative edge
|
||||
coils->sparkDelay = (int32_t)(coils->sparkTime - coils->coilTime);
|
||||
coils->softStartStatus = softStartStatusEnum::NORMAL; // because spark on positive edge
|
||||
coils->sparkStatus = sparkStatusEnum::SPARK_POS_OK; // do not wait for spark on negative edge
|
||||
}
|
||||
// Timeout occourred, expected POSITIVE edge spark NOT OCCOURRED
|
||||
else if (spark_flag == SPARK_FLAG_TIMEOUT)
|
||||
else if (sparkFlag == SPARK_FLAG_TIMEOUT)
|
||||
{
|
||||
coils->spark_status = sparkStatus::SPARK_NEG_WAIT;
|
||||
coils->sstart_status = softStartStatus::NORMAL;
|
||||
coils->sparkStatus = sparkStatusEnum::SPARK_NEG_WAIT;
|
||||
coils->softStartStatus = softStartStatusEnum::NORMAL;
|
||||
}
|
||||
continue; // Do nothing more on positive pulse
|
||||
}
|
||||
@@ -193,29 +194,29 @@ void rtIgnitionTask::rtIgnitionTask_realtime(void *pvParameters)
|
||||
case TRIG_FLAG_12N:
|
||||
case TRIG_FLAG_34N:
|
||||
{
|
||||
const bool expected_negative = coils->spark_status == sparkStatus::SPARK_NEG_WAIT;
|
||||
const bool negativeSparkExpected = coils->sparkStatus == sparkStatusEnum::SPARK_NEG_WAIT;
|
||||
// Timeout not occourred, expected NEGATIVE edge spark OCCOURRED
|
||||
if (spark_flag != SPARK_FLAG_TIMEOUT && expected_negative)
|
||||
if (sparkFlag != SPARK_FLAG_TIMEOUT && negativeSparkExpected)
|
||||
{
|
||||
coils->spark_delay = (int32_t)(coils->spark_time - coils->trig_time);
|
||||
coils->sstart_status = softStartStatus::SOFT_START;
|
||||
coils->spark_status = sparkStatus::SPARK_NEG_OK;
|
||||
coils->sparkDelay = (int32_t)(coils->sparkTime - coils->coilTime);
|
||||
coils->softStartStatus = softStartStatusEnum::SOFT_START;
|
||||
coils->sparkStatus = sparkStatusEnum::SPARK_NEG_OK;
|
||||
}
|
||||
// Timeout occourred, expected POSITIVE edge spark NOT OCCOURRED
|
||||
else if (spark_flag == SPARK_FLAG_TIMEOUT && expected_negative)
|
||||
else if (sparkFlag == SPARK_FLAG_TIMEOUT && negativeSparkExpected)
|
||||
{
|
||||
coils->sstart_status = softStartStatus::ERROR;
|
||||
coils->spark_status = sparkStatus::SPARK_NEG_FAIL;
|
||||
coils->softStartStatus = softStartStatusEnum::ERROR;
|
||||
coils->sparkStatus = sparkStatusEnum::SPARK_NEG_FAIL;
|
||||
}
|
||||
// Timeout not occouured, unexpected negative edge spark
|
||||
else if (spark_flag != SPARK_FLAG_TIMEOUT && !expected_negative)
|
||||
else if (sparkFlag != SPARK_FLAG_TIMEOUT && !negativeSparkExpected)
|
||||
{
|
||||
coils->sstart_status = softStartStatus::SOFT_START;
|
||||
coils->spark_status = sparkStatus::SPARK_NEG_UNEXPECTED;
|
||||
coils->softStartStatus = softStartStatusEnum::SOFT_START;
|
||||
coils->sparkStatus = sparkStatusEnum::SPARK_NEG_UNEXPECTED;
|
||||
}
|
||||
// Wait for finish of negative pulse to save data to buffer
|
||||
coils->n_events++;
|
||||
if (pickup_flag == TRIG_FLAG_12N)
|
||||
coils->nEvents++;
|
||||
if (pickupFlag == TRIG_FLAG_12N)
|
||||
cycle12 = true;
|
||||
else
|
||||
cycle34 = true;
|
||||
@@ -227,102 +228,122 @@ void rtIgnitionTask::rtIgnitionTask_realtime(void *pvParameters)
|
||||
|
||||
if (cycle12 && cycle34) // wait for both 12 and 34 cycles to complete before sending data to main loop and resetting peak detectors
|
||||
{
|
||||
// disable interrupts during adc samples
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_12p));
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_12n));
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_34p));
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_34n));
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.sparkPin_12));
|
||||
disableInterrupt(digitalPinToInterrupt(rtInterrupts.sparkPin_34));
|
||||
|
||||
// reset coils 12 and 34 cycles
|
||||
cycle12 = false;
|
||||
cycle34 = false;
|
||||
|
||||
if (ign_box_sts.coils12.spark_status == sparkStatus::SPARK_POS_FAIL || ign_box_sts.coils12.spark_status == sparkStatus::SPARK_NEG_FAIL)
|
||||
ign_box_sts.coils12.n_missed_firing++;
|
||||
if (ign_box_sts.coils34.spark_status == sparkStatus::SPARK_POS_FAIL || ign_box_sts.coils34.spark_status == sparkStatus::SPARK_NEG_FAIL)
|
||||
ign_box_sts.coils34.n_missed_firing++;
|
||||
if (ignBoxStatus.coils12.sparkStatus == sparkStatusEnum::SPARK_POS_FAIL || ignBoxStatus.coils12.sparkStatus == sparkStatusEnum::SPARK_NEG_FAIL)
|
||||
ignBoxStatus.coils12.nMissedFiring++;
|
||||
if (ignBoxStatus.coils34.sparkStatus == sparkStatusEnum::SPARK_POS_FAIL || ignBoxStatus.coils34.sparkStatus == sparkStatusEnum::SPARK_NEG_FAIL)
|
||||
ignBoxStatus.coils34.nMissedFiring++;
|
||||
|
||||
// read adc channels: pickup12, out12 [ pos + neg ]
|
||||
if (adc) // read only if adc initialized
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(spi_mutex);
|
||||
uint32_t start_adc_read = esp_timer_get_time();
|
||||
uint32_t startAdcReadTime = esp_timer_get_time();
|
||||
// from peak detector circuits
|
||||
ign_box_sts.coils12.peak_p_in = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils12.peak_n_in = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils34.peak_p_in = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils34.peak_n_in = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils12.peak_p_out = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils12.peak_n_out = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils34.peak_p_out = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.coils34.peak_n_out = adc->convertToVoltage(adc->cycleSingle());
|
||||
ign_box_sts.adc_read_time = (int32_t)(esp_timer_get_time() - start_adc_read);
|
||||
ignBoxStatus.coils12.peakPos = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils12.peakNeg = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils34.peakPos = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils34.peakNeg = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils12.trigLevelPos = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils12.trigLevelNeg = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils34.trigLevelPos = adc->convertToVoltage(adc->cycleSingle());
|
||||
ignBoxStatus.coils34.trigLevelNeg = adc->convertToVoltage(adc->cycleSingle());
|
||||
adc->stopConversion();
|
||||
ignBoxStatus.adcReadTime = (int32_t)(esp_timer_get_time() - startAdcReadTime);
|
||||
}
|
||||
else // simulate adc read timig
|
||||
vTaskDelay(pdMS_TO_TICKS(c_adc_time));
|
||||
vTaskDelay(pdMS_TO_TICKS(c_adcTime));
|
||||
|
||||
// reset peak detectors + sample and hold
|
||||
// outputs on io expander
|
||||
if (io)
|
||||
{
|
||||
uint32_t startIoReadWriteTime = esp_timer_get_time();
|
||||
// Discharge Pulse
|
||||
io->extDigitalWrite(rt_rst.sh_disch_12, true);
|
||||
io->extDigitalWrite(rt_rst.sh_disch_34, true);
|
||||
io->extDigitalWrite(rtResets.sh_disch_12, true);
|
||||
io->extDigitalWrite(rtResets.sh_disch_34, true);
|
||||
delayMicroseconds(250);
|
||||
io->extDigitalWrite(rt_rst.sh_disch_12, false);
|
||||
io->extDigitalWrite(rt_rst.sh_disch_34, false);
|
||||
io->extDigitalWrite(rtResets.sh_disch_12, false);
|
||||
io->extDigitalWrite(rtResets.sh_disch_34, false);
|
||||
// Safety delay
|
||||
delayMicroseconds(500);
|
||||
// Re-Arm Pulse
|
||||
io->extDigitalWrite(rt_rst.sh_arm_12, true);
|
||||
io->extDigitalWrite(rt_rst.sh_arm_34, true);
|
||||
io->extDigitalWrite(rtResets.sh_arm_12, true);
|
||||
io->extDigitalWrite(rtResets.sh_arm_34, true);
|
||||
delayMicroseconds(250);
|
||||
io->extDigitalWrite(rt_rst.sh_arm_12, false);
|
||||
io->extDigitalWrite(rt_rst.sh_arm_34, false);
|
||||
io->extDigitalWrite(rtResets.sh_arm_12, false);
|
||||
io->extDigitalWrite(rtResets.sh_arm_34, false);
|
||||
ignBoxStatus.ioReadWriteTime = (int32_t)(esp_timer_get_time() - startIoReadWriteTime);
|
||||
}
|
||||
else
|
||||
vTaskDelay(pdMS_TO_TICKS(c_io_time));
|
||||
vTaskDelay(pdMS_TO_TICKS(c_ioTime));
|
||||
|
||||
// send essage to main loop with ignition info, by copy so local static variable is ok
|
||||
if (rt_queue)
|
||||
if (rtQueue)
|
||||
{
|
||||
ign_box_sts.timestamp = esp_timer_get_time(); // update data timestamp
|
||||
if (xQueueSendToBack(rt_queue, (void *)&ign_box_sts, 0) != pdPASS)
|
||||
ign_box_sts.n_queue_errors = ++n_errors;
|
||||
ignBoxStatus.timestamp = esp_timer_get_time(); // update data timestamp
|
||||
if (xQueueSendToBack(rtQueue, (void *)&ignBoxStatus, 0) != pdPASS)
|
||||
ignBoxStatus.nQueueErrors = ++nErrors;
|
||||
}
|
||||
|
||||
// enable interrupts ready for a new cycle
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_12p));
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_12n));
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_34p));
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.trigPin_34n));
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.sparkPin_12));
|
||||
enableInterrupt(digitalPinToInterrupt(rtInterrupts.sparkPin_34));
|
||||
}
|
||||
}
|
||||
// Delete the timeout timer
|
||||
esp_timer_delete(timeout_timer);
|
||||
esp_timer_stop(timeoutTimer);
|
||||
esp_timer_delete(timeoutTimer);
|
||||
LOG_WARN("rtTask Ending [", params->name.c_str(), "]");
|
||||
// Ignition A Interrupts DETACH
|
||||
detachInterrupt(rt_int.trig_pin_12p);
|
||||
detachInterrupt(rt_int.trig_pin_12n);
|
||||
detachInterrupt(rt_int.trig_pin_34p);
|
||||
detachInterrupt(rt_int.trig_pin_34n);
|
||||
detachInterrupt(rt_int.spark_pin_12);
|
||||
detachInterrupt(rt_int.spark_pin_34);
|
||||
detachInterrupt(rtInterrupts.trigPin_12p);
|
||||
detachInterrupt(rtInterrupts.trigPin_12n);
|
||||
detachInterrupt(rtInterrupts.trigPin_34p);
|
||||
detachInterrupt(rtInterrupts.trigPin_34n);
|
||||
detachInterrupt(rtInterrupts.sparkPin_12);
|
||||
detachInterrupt(rtInterrupts.sparkPin_34);
|
||||
// delete present task
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
///////////// CLASS MEMBER DEFINITIONS /////////////
|
||||
rtIgnitionTask::rtIgnitionTask(const rtTaskParams params, const uint32_t history_size, const uint32_t queue_size, const uint8_t core, std::mutex &fs_mutex, fs::FS &filesystem) : m_params(params), m_filesystem(filesystem), m_fs_mutex(fs_mutex), m_core(core), m_max_history(history_size)
|
||||
rtIgnitionTask::rtIgnitionTask(const rtTaskParams params, const uint32_t history_size, const uint32_t queue_size, const uint8_t core, std::mutex &fs_mutex, fs::FS &filesystem) : m_params(params), m_filesystem(filesystem), m_filesystemMutex(fs_mutex), m_core(core), m_historyMax(history_size)
|
||||
{
|
||||
LOG_WARN("Starting Manager for [", m_params.name.c_str(), "]");
|
||||
// create queue buffers
|
||||
m_queue = xQueueCreate(queue_size, sizeof(ignitionBoxStatus));
|
||||
if (!m_queue)
|
||||
m_rtQueueHandle = xQueueCreate(queue_size, sizeof(ignitionBoxStatus));
|
||||
if (!m_rtQueueHandle)
|
||||
{
|
||||
LOG_ERROR("Unable To Create Task [", params.name.c_str(), "] queues");
|
||||
m_manager_status = rtTaskStatus::ERROR;
|
||||
m_managerStatus = rtTaskStatus::ERROR;
|
||||
return;
|
||||
}
|
||||
else
|
||||
m_params.rt_queue = m_queue;
|
||||
m_params.rt_queue = m_rtQueueHandle;
|
||||
|
||||
try
|
||||
{
|
||||
// create PSram history vectors
|
||||
m_history_0 = PSHistory(history_size);
|
||||
m_history_1 = PSHistory(history_size);
|
||||
m_historyBuf0 = PSHistory(history_size);
|
||||
m_historyBuf1 = PSHistory(history_size);
|
||||
// assing active and writable history
|
||||
m_active_history = std::unique_ptr<PSHistory>(&m_history_0);
|
||||
m_save_history = std::unique_ptr<PSHistory>(&m_history_1);
|
||||
m_historyActive = std::unique_ptr<PSHistory>(&m_historyBuf0);
|
||||
m_historyInactive = std::unique_ptr<PSHistory>(&m_historyBuf1);
|
||||
}
|
||||
catch (std::bad_alloc &e)
|
||||
{
|
||||
@@ -330,86 +351,87 @@ rtIgnitionTask::rtIgnitionTask(const rtTaskParams params, const uint32_t history
|
||||
return;
|
||||
}
|
||||
|
||||
m_name = (std::string("man_") + m_params.name).c_str();
|
||||
m_managerTaskName = (std::string("man_") + m_params.name).c_str();
|
||||
auto task_success = xTaskCreatePinnedToCore(
|
||||
rtIgnitionTask_manager,
|
||||
m_name.c_str(),
|
||||
m_managerTaskName.c_str(),
|
||||
RT_TASK_STACK,
|
||||
(void *)this,
|
||||
m_params.rt_priority >> 2,
|
||||
&m_manager_handle,
|
||||
&m_managerHandle,
|
||||
m_core);
|
||||
|
||||
if (task_success != pdPASS)
|
||||
{
|
||||
LOG_ERROR("Unable To Create Manager for [", params.name.c_str(), "]");
|
||||
m_manager_status = rtTaskStatus::ERROR;
|
||||
m_managerStatus = rtTaskStatus::ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
// average every 10 samples
|
||||
m_info_filtered = ignitionBoxStatusFiltered(10);
|
||||
m_last_data = millis();
|
||||
m_manager_status = rtTaskStatus::OK;
|
||||
m_statusFiltered = ignitionBoxStatusFiltered(m_filterSize);
|
||||
m_dataLast = millis();
|
||||
m_managerStatus = rtTaskStatus::OK;
|
||||
}
|
||||
|
||||
rtIgnitionTask::~rtIgnitionTask()
|
||||
{
|
||||
if (m_rt_handle)
|
||||
vTaskDelete(m_rt_handle);
|
||||
if (m_manager_handle)
|
||||
vTaskDelete(m_manager_handle);
|
||||
if (m_queue)
|
||||
vQueueDelete(m_queue);
|
||||
if (m_rtHandle)
|
||||
vTaskDelete(m_rtHandle);
|
||||
if (m_managerHandle)
|
||||
vTaskDelete(m_managerHandle);
|
||||
if (m_rtQueueHandle)
|
||||
vQueueDelete(m_rtQueueHandle);
|
||||
}
|
||||
|
||||
void rtIgnitionTask::run()
|
||||
{
|
||||
// receive new data from the queue
|
||||
auto new_data = xQueueReceive(m_queue, &m_last_status, 0); // non blocking receive
|
||||
auto new_data = xQueueReceive(m_rtQueueHandle, &m_statusLast, 0); // non blocking receive
|
||||
|
||||
if (new_data == pdPASS)
|
||||
{
|
||||
m_last_data = millis();
|
||||
m_manager_status = rtTaskStatus::RUNNING;
|
||||
m_dataLast = millis();
|
||||
m_managerStatus = rtTaskStatus::RUNNING;
|
||||
// if history buffer is full swap buffers and if enabled save history buffer
|
||||
if (m_counter_status >= m_max_history)
|
||||
if (m_statusCounter >= m_historyMax)
|
||||
{
|
||||
LOG_DEBUG("Save for Buffer Full: ", m_counter_status);
|
||||
m_counter_status = 0;
|
||||
m_partial_save = false; // reset partial save flag on new data cycle
|
||||
std::swap(m_active_history, m_save_history);
|
||||
if (m_enable_save)
|
||||
saveHistory(*m_save_history, m_history_path); // directly call the save task function to save without delay
|
||||
LOG_DEBUG("Save for Buffer Full: ", m_statusCounter);
|
||||
m_statusCounter = 0;
|
||||
m_savePartial = false; // reset partial save flag on new data cycle
|
||||
std::swap(m_historyActive, m_historyInactive);
|
||||
if (m_historySaveEnable)
|
||||
saveHistory(*m_historyInactive, m_historyPath); // directly call the save task function to save without delay
|
||||
LOG_INFO("Save History");
|
||||
}
|
||||
|
||||
// update filtered data
|
||||
m_info_filtered.update(m_last_status);
|
||||
(*m_active_history)[m_counter_status] = m_last_status;
|
||||
m_statusFiltered.update(m_statusLast);
|
||||
(*m_historyActive)[m_statusCounter] = m_statusLast;
|
||||
|
||||
if (m_on_message_cb && m_counter_status % 10 == 0)
|
||||
// callback
|
||||
if (m_onFilteredStatusUpdate && m_statusCounter % m_filterSize == 0)
|
||||
{
|
||||
m_on_message_cb(m_info_filtered);
|
||||
m_onFilteredStatusUpdate(m_statusFiltered);
|
||||
}
|
||||
|
||||
// update data counter
|
||||
m_counter_status++;
|
||||
m_statusCounter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (millis() - m_last_data > c_idle_time)
|
||||
if (millis() - m_dataLast > c_idleTime)
|
||||
{
|
||||
if (m_counter_status > 0 && !m_partial_save)
|
||||
if (m_statusCounter > 0 && !m_savePartial)
|
||||
{
|
||||
LOG_DEBUG("Save Partial: ", m_counter_status);
|
||||
m_active_history->resize(m_counter_status);
|
||||
saveHistory(*m_active_history, m_history_path);
|
||||
m_active_history->resize(m_max_history);
|
||||
m_counter_status = 0;
|
||||
m_partial_save = true;
|
||||
LOG_DEBUG("Save Partial: ", m_statusCounter);
|
||||
m_historyActive->resize(m_statusCounter);
|
||||
saveHistory(*m_historyActive, m_historyPath);
|
||||
m_historyActive->resize(m_historyMax);
|
||||
m_statusCounter = 0;
|
||||
m_savePartial = true;
|
||||
}
|
||||
m_manager_status = rtTaskStatus::IDLE;
|
||||
m_managerStatus = rtTaskStatus::IDLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,22 +445,22 @@ const bool rtIgnitionTask::start()
|
||||
m_params.rt_stack_size,
|
||||
(void *)&m_params,
|
||||
m_params.rt_priority,
|
||||
&m_rt_handle,
|
||||
&m_rtHandle,
|
||||
m_core);
|
||||
const bool success = task_success == pdPASS && m_rt_handle != nullptr;
|
||||
const bool success = task_success == pdPASS && m_rtHandle != nullptr;
|
||||
if (success)
|
||||
m_manager_status = rtTaskStatus::IDLE;
|
||||
m_managerStatus = rtTaskStatus::IDLE;
|
||||
return success;
|
||||
}
|
||||
|
||||
const bool rtIgnitionTask::stop()
|
||||
{
|
||||
LOG_WARN("Ending Task [", m_params.name.c_str(), "]");
|
||||
if (m_rt_handle)
|
||||
if (m_rtHandle)
|
||||
{
|
||||
m_params.rt_running = false;
|
||||
m_rt_handle = nullptr;
|
||||
m_manager_status = rtTaskStatus::STOPPED;
|
||||
m_rtHandle = nullptr;
|
||||
m_managerStatus = rtTaskStatus::STOPPED;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -446,26 +468,26 @@ const bool rtIgnitionTask::stop()
|
||||
|
||||
const ignitionBoxStatus rtIgnitionTask::getLast() const
|
||||
{
|
||||
return m_last_status;
|
||||
return m_statusLast;
|
||||
}
|
||||
|
||||
const ignitionBoxStatusFiltered rtIgnitionTask::getFiltered() const
|
||||
{
|
||||
return m_info_filtered;
|
||||
return m_statusFiltered;
|
||||
}
|
||||
|
||||
const rtIgnitionTask::rtTaskStatus rtIgnitionTask::getStatus() const
|
||||
{
|
||||
return m_manager_status;
|
||||
return m_managerStatus;
|
||||
}
|
||||
|
||||
void rtIgnitionTask::enableSave(const bool enable, const std::filesystem::path filename)
|
||||
{
|
||||
m_enable_save = enable;
|
||||
m_historySaveEnable = enable;
|
||||
if (enable && !filename.empty())
|
||||
{
|
||||
LOG_WARN("Save History Enabled Task [", m_params.name.c_str(), "]");
|
||||
m_history_path = m_filesystem.mountpoint() / filename;
|
||||
m_historyPath = m_filesystem.mountpoint() / filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -475,13 +497,13 @@ void rtIgnitionTask::enableSave(const bool enable, const std::filesystem::path f
|
||||
|
||||
void rtIgnitionTask::onMessage(std::function<void(ignitionBoxStatusFiltered)> callaback)
|
||||
{
|
||||
m_on_message_cb = callaback;
|
||||
m_onFilteredStatusUpdate = callaback;
|
||||
}
|
||||
|
||||
void rtIgnitionTask::saveHistory(const rtIgnitionTask::PSHistory &history, const std::filesystem::path &file_name)
|
||||
void rtIgnitionTask::saveHistory(const rtIgnitionTask::PSHistory &history, const std::filesystem::path &fileName)
|
||||
{
|
||||
// Lock filesystem mutex to avoid concurrent access
|
||||
std::lock_guard<std::mutex> fs_lock(m_fs_mutex);
|
||||
std::lock_guard<std::mutex> fs_lock(m_filesystemMutex);
|
||||
|
||||
// Check for free space
|
||||
if (LittleFS.totalBytes() - LittleFS.usedBytes() < history.size() * sizeof(ignitionBoxStatus)) // check if at least 1MB is free for saving history
|
||||
@@ -491,26 +513,26 @@ void rtIgnitionTask::saveHistory(const rtIgnitionTask::PSHistory &history, const
|
||||
}
|
||||
|
||||
// create complete file path
|
||||
const std::filesystem::path mount_point = std::filesystem::path(m_filesystem.mountpoint());
|
||||
std::filesystem::path file_path = file_name;
|
||||
if (file_name.root_path() != mount_point)
|
||||
file_path = mount_point / file_name;
|
||||
const std::filesystem::path mountPoint = std::filesystem::path(m_filesystem.mountpoint());
|
||||
std::filesystem::path filePath = fileName;
|
||||
if (fileName.root_path() != mountPoint)
|
||||
filePath = mountPoint / fileName;
|
||||
|
||||
// if firt save remove old file and create new
|
||||
auto save_flags = std::ios::out;
|
||||
if (m_first_save)
|
||||
auto saveFlags = std::ios::out;
|
||||
if (m_saveFirst)
|
||||
{
|
||||
save_flags |= std::ios::trunc; // overwrite existing file
|
||||
m_filesystem.remove(file_path.c_str()); // ensure file is removed before saving to avoid issues with appending to existing file in SPIFFS
|
||||
LOG_INFO("Saving history to Flash, new file:", file_path.c_str());
|
||||
saveFlags |= std::ios::trunc; // overwrite existing file
|
||||
m_filesystem.remove(filePath.c_str()); // ensure file is removed before saving to avoid issues with appending to existing file in SPIFFS
|
||||
LOG_INFO("Saving history to Flash, new file:", filePath.c_str());
|
||||
}
|
||||
else // else append to existing file
|
||||
{
|
||||
save_flags |= std::ios::app; // append to new file
|
||||
LOG_INFO("Saving history to Flash, appending to existing file:", file_path.c_str());
|
||||
saveFlags |= std::ios::app; // append to new file
|
||||
LOG_INFO("Saving history to Flash, appending to existing file:", filePath.c_str());
|
||||
}
|
||||
|
||||
std::ofstream ofs(file_path, save_flags);
|
||||
std::ofstream ofs(filePath, saveFlags);
|
||||
if (ofs.fail())
|
||||
{
|
||||
LOG_ERROR("Failed to open file for writing");
|
||||
@@ -518,38 +540,38 @@ void rtIgnitionTask::saveHistory(const rtIgnitionTask::PSHistory &history, const
|
||||
}
|
||||
|
||||
// write csv header
|
||||
if (m_first_save)
|
||||
if (m_saveFirst)
|
||||
{
|
||||
ofs << "TS,EVENTS_12,DLY_12,STAT_12,V_12_1,V_12_2,V_12_3,V_12_4,IGNITION_MODE_12,"
|
||||
<< "EVENTS_34,DLY_34,STAT_34,V_34_1,V_34_2,V_34_3,V_34_4,IGNITION_MODE_34,"
|
||||
<< "ENGINE_RPM,ADC_READTIME,N_QUEUE_ERRORS"
|
||||
<< std::endl;
|
||||
ofs.flush();
|
||||
m_first_save = false;
|
||||
m_saveFirst = false;
|
||||
}
|
||||
|
||||
for (const auto &entry : history)
|
||||
{
|
||||
ofs << std::to_string(entry.timestamp) << ","
|
||||
<< std::to_string(entry.coils12.n_events) << ","
|
||||
<< std::to_string(entry.coils12.spark_delay) << ","
|
||||
<< std::string(sparkStatusNames.at(entry.coils12.spark_status)) << ","
|
||||
<< std::to_string(entry.coils12.peak_p_in) << ","
|
||||
<< std::to_string(entry.coils12.peak_n_in) << ","
|
||||
<< std::to_string(entry.coils12.peak_p_out) << ","
|
||||
<< std::to_string(entry.coils12.peak_n_out) << ","
|
||||
<< std::string(softStartStatusNames.at(entry.coils12.sstart_status)) << ","
|
||||
<< std::to_string(entry.coils34.n_events) << ","
|
||||
<< std::to_string(entry.coils34.spark_delay) << ","
|
||||
<< std::string(sparkStatusNames.at(entry.coils34.spark_status)) << ","
|
||||
<< std::to_string(entry.coils34.peak_p_in) << ","
|
||||
<< std::to_string(entry.coils34.peak_n_in) << ","
|
||||
<< std::to_string(entry.coils34.peak_p_out) << ","
|
||||
<< std::to_string(entry.coils34.peak_n_out) << ","
|
||||
<< std::string(softStartStatusNames.at(entry.coils34.sstart_status)) << ","
|
||||
<< std::to_string(entry.eng_rpm) << ","
|
||||
<< std::to_string(entry.adc_read_time) << ","
|
||||
<< std::to_string(entry.n_queue_errors);
|
||||
<< std::to_string(entry.coils12.nEvents) << ","
|
||||
<< std::to_string(entry.coils12.sparkDelay) << ","
|
||||
<< std::string(sparkStatusNames.at(entry.coils12.sparkStatus)) << ","
|
||||
<< std::to_string(entry.coils12.peakPos) << ","
|
||||
<< std::to_string(entry.coils12.peakNeg) << ","
|
||||
<< std::to_string(entry.coils12.trigLevelPos) << ","
|
||||
<< std::to_string(entry.coils12.trigLevelNeg) << ","
|
||||
<< std::string(softStartStatusNames.at(entry.coils12.softStartStatus)) << ","
|
||||
<< std::to_string(entry.coils34.nEvents) << ","
|
||||
<< std::to_string(entry.coils34.sparkDelay) << ","
|
||||
<< std::string(sparkStatusNames.at(entry.coils34.sparkStatus)) << ","
|
||||
<< std::to_string(entry.coils34.peakPos) << ","
|
||||
<< std::to_string(entry.coils34.peakNeg) << ","
|
||||
<< std::to_string(entry.coils34.trigLevelPos) << ","
|
||||
<< std::to_string(entry.coils34.trigLevelNeg) << ","
|
||||
<< std::string(softStartStatusNames.at(entry.coils34.softStartStatus)) << ","
|
||||
<< std::to_string(entry.engRpm) << ","
|
||||
<< std::to_string(entry.adcReadTime) << ","
|
||||
<< std::to_string(entry.nQueueErrors);
|
||||
ofs << std::endl;
|
||||
ofs.flush();
|
||||
}
|
||||
|
||||
+34
-36
@@ -22,9 +22,6 @@
|
||||
// DEVICES
|
||||
#include "devices.h"
|
||||
|
||||
// Global Variables and Flags
|
||||
const uint32_t spark_timeout_max = 500; // in microseconds
|
||||
|
||||
// Debug Variables
|
||||
#ifdef DEBUG
|
||||
static const std::map<const uint32_t, const char *> names = {
|
||||
@@ -46,13 +43,13 @@ public:
|
||||
// RT task Interrupt parameters
|
||||
struct rtTaskInterruptParams
|
||||
{
|
||||
void (*isr_ptr)(void *);
|
||||
const uint8_t trig_pin_12p;
|
||||
const uint8_t trig_pin_12n;
|
||||
const uint8_t trig_pin_34p;
|
||||
const uint8_t trig_pin_34n;
|
||||
const uint8_t spark_pin_12;
|
||||
const uint8_t spark_pin_34;
|
||||
void (*isrPtr)(void *);
|
||||
const uint8_t trigPin_12p;
|
||||
const uint8_t trigPin_12n;
|
||||
const uint8_t trigPin_34p;
|
||||
const uint8_t trigPin_34n;
|
||||
const uint8_t sparkPin_12;
|
||||
const uint8_t sparkPin_34;
|
||||
};
|
||||
|
||||
// RT Task Peak Detector Reset pins
|
||||
@@ -123,38 +120,39 @@ private: // static functions for FreeRTOS
|
||||
|
||||
private:
|
||||
bool m_running = true;
|
||||
rtTaskStatus m_manager_status = INIT;
|
||||
std::string m_name;
|
||||
|
||||
rtTaskStatus m_managerStatus = INIT;
|
||||
rtTaskParams m_params;
|
||||
|
||||
const uint8_t m_core;
|
||||
std::string m_managerTaskName;
|
||||
TaskHandle_t m_rtHandle = nullptr;
|
||||
TaskHandle_t m_managerHandle = nullptr;
|
||||
QueueHandle_t m_rtQueueHandle = nullptr;
|
||||
|
||||
TaskHandle_t m_rt_handle = nullptr;
|
||||
TaskHandle_t m_manager_handle = nullptr;
|
||||
QueueHandle_t m_queue = nullptr;
|
||||
const uint32_t m_historyMax;
|
||||
bool m_historySaveEnable = false;
|
||||
std::filesystem::path m_historyPath;
|
||||
PSHistory m_historyBuf0;
|
||||
PSHistory m_historyBuf1;
|
||||
std::unique_ptr<PSHistory> m_historyActive;
|
||||
std::unique_ptr<PSHistory> m_historyInactive;
|
||||
|
||||
bool m_enable_save = false;
|
||||
std::filesystem::path m_history_path;
|
||||
const uint32_t m_max_history;
|
||||
PSHistory m_history_0;
|
||||
PSHistory m_history_1;
|
||||
std::unique_ptr<PSHistory> m_active_history;
|
||||
std::unique_ptr<PSHistory> m_save_history;
|
||||
bool m_savePartial = false;
|
||||
bool m_saveFirst = true;
|
||||
fs::FS &m_filesystem;
|
||||
std::mutex &m_fs_mutex;
|
||||
std::mutex &m_filesystemMutex;
|
||||
|
||||
bool m_partial_save = false;
|
||||
bool m_first_save = true;
|
||||
uint8_t m_filterSize = 10;
|
||||
uint32_t m_statusCounter = 0;
|
||||
uint32_t m_dataLast = 0;
|
||||
ignitionBoxStatus m_statusLast;
|
||||
ignitionBoxStatusFiltered m_statusFiltered;
|
||||
|
||||
uint32_t m_counter_status = 0;
|
||||
uint32_t m_last_data = 0;
|
||||
ignitionBoxStatus m_last_status;
|
||||
ignitionBoxStatusFiltered m_info_filtered;
|
||||
std::function<void(ignitionBoxStatusFiltered)> m_onFilteredStatusUpdate = nullptr;
|
||||
|
||||
std::function<void(ignitionBoxStatusFiltered)> m_on_message_cb = nullptr;
|
||||
|
||||
static const uint32_t c_idle_time = 10000; // in mS
|
||||
static const uint32_t c_spark_timeout_max = 500; // uS
|
||||
static const uint8_t c_adc_time = 4; // in mS
|
||||
static const uint8_t c_io_time = 2; // in mS
|
||||
// Global Variables and Flags
|
||||
static const uint32_t c_sparkTimeoutMax = 500; // in microseconds
|
||||
static const uint32_t c_idleTime = 10000; // in mS
|
||||
static const uint8_t c_adcTime = 4; // in mS
|
||||
static const uint8_t c_ioTime = 2; // in mS
|
||||
};
|
||||
|
||||
+21
-21
@@ -44,30 +44,30 @@ void printInfo(const ignitionBoxStatus &info)
|
||||
setCursor(0, 0);
|
||||
printField("++ Timestamp ++", (uint32_t)info.timestamp);
|
||||
Serial.println("========== Coils 12 =============");
|
||||
printField("Events", info.coils12.n_events);
|
||||
printField("Events Missed", info.coils12.n_missed_firing);
|
||||
printField("Spark Dly", (uint32_t)info.coils12.spark_delay);
|
||||
printField("Spark Sts", sparkStatusNames.at(info.coils12.spark_status));
|
||||
printField("Peak P_IN", info.coils12.peak_p_in);
|
||||
printField("Peak N_IN", info.coils12.peak_n_in);
|
||||
printField("Peak P_OUT", info.coils12.peak_p_out);
|
||||
printField("Peak N_OUT", info.coils12.peak_n_out);
|
||||
printField("Soft Start ", softStartStatusNames.at(info.coils12.sstart_status));
|
||||
printField("Events", info.coils12.nEvents);
|
||||
printField("Events Missed", info.coils12.nMissedFiring);
|
||||
printField("Spark Dly", (uint32_t)info.coils12.sparkDelay);
|
||||
printField("Spark Sts", sparkStatusNames.at(info.coils12.sparkStatus));
|
||||
printField("Peak P_IN", info.coils12.peakPos);
|
||||
printField("Peak N_IN", info.coils12.peakNeg);
|
||||
printField("Peak P_OUT", info.coils12.trigLevelPos);
|
||||
printField("Peak N_OUT", info.coils12.trigLevelNeg);
|
||||
printField("Soft Start ", softStartStatusNames.at(info.coils12.softStartStatus));
|
||||
|
||||
Serial.println("========== Coils 34 =============");
|
||||
printField("Events", info.coils34.n_events);
|
||||
printField("Events Missed", info.coils34.n_missed_firing);
|
||||
printField("Spark Dly", (uint32_t)info.coils34.spark_delay);
|
||||
printField("Spark Sts", sparkStatusNames.at(info.coils34.spark_status));
|
||||
printField("Peak P_IN", info.coils34.peak_p_in);
|
||||
printField("Peak N_IN", info.coils34.peak_n_in);
|
||||
printField("Peak P_OUT", info.coils34.peak_p_out);
|
||||
printField("Peak N_OUT", info.coils34.peak_n_out);
|
||||
printField("Soft Start ", softStartStatusNames.at(info.coils34.sstart_status));
|
||||
printField("Events", info.coils34.nEvents);
|
||||
printField("Events Missed", info.coils34.nMissedFiring);
|
||||
printField("Spark Dly", (uint32_t)info.coils34.sparkDelay);
|
||||
printField("Spark Sts", sparkStatusNames.at(info.coils34.sparkStatus));
|
||||
printField("Peak P_IN", info.coils34.peakPos);
|
||||
printField("Peak N_IN", info.coils34.peakNeg);
|
||||
printField("Peak P_OUT", info.coils34.trigLevelPos);
|
||||
printField("Peak N_OUT", info.coils34.trigLevelNeg);
|
||||
printField("Soft Start ", softStartStatusNames.at(info.coils34.softStartStatus));
|
||||
|
||||
Serial.println("============ END ===============");
|
||||
Serial.println();
|
||||
printField("Engine RPM", info.eng_rpm);
|
||||
printField("ADC Read Time", info.adc_read_time);
|
||||
printField("Queue Errors", info.n_queue_errors);
|
||||
printField("Engine RPM", info.engRpm);
|
||||
printField("ADC Read Time", info.adcReadTime);
|
||||
printField("Queue Errors", info.nQueueErrors);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ void on_ping(TimerHandle_t xTimer)
|
||||
ws->cleanupClients();
|
||||
}
|
||||
|
||||
AstroWebServer::AstroWebServer(const uint8_t port, fs::FS &filesystem) : m_port(port), m_webserver(AsyncWebServer(port)), m_websocket(AsyncWebSocket("/ws")), m_filesystem(filesystem)
|
||||
AstroWebServer::AstroWebServer(const uint8_t port, fs::FS &filesystem) : c_port(port), m_webserver(AsyncWebServer(port)), m_websocket(AsyncWebSocket("/ws")), m_filesystem(filesystem)
|
||||
{
|
||||
LOG_DEBUG("Initializing Web Server");
|
||||
m_websocket.onEvent([this](AsyncWebSocket *server, AsyncWebSocketClient *client,
|
||||
@@ -26,7 +26,8 @@ AstroWebServer::AstroWebServer(const uint8_t port, fs::FS &filesystem) : m_port(
|
||||
m_webserver.begin();
|
||||
m_websocket.enable(true);
|
||||
|
||||
m_pingTimer = xTimerCreate("wsPingTimer", pdMS_TO_TICKS(2000), pdTRUE, (void *)&m_websocket, on_ping);
|
||||
m_pingTimer = xTimerCreate("wsPingTimer", pdMS_TO_TICKS(c_pingTime), pdTRUE, (void *)&m_websocket, on_ping);
|
||||
xTimerStart(m_pingTimer, pdMS_TO_TICKS(10));
|
||||
|
||||
registerWsCommand("setTime", [this](const ArduinoJson::JsonDocument &doc)
|
||||
{ onSetTme(doc); });
|
||||
@@ -36,6 +37,7 @@ AstroWebServer::AstroWebServer(const uint8_t port, fs::FS &filesystem) : m_port(
|
||||
|
||||
AstroWebServer::~AstroWebServer()
|
||||
{
|
||||
xTimerStop(m_pingTimer, 0);
|
||||
xTimerDelete(m_pingTimer, pdMS_TO_TICKS(10));
|
||||
m_webserver.removeHandler(&m_websocket);
|
||||
m_webserver.end();
|
||||
@@ -69,13 +71,13 @@ void AstroWebServer::onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *cli
|
||||
switch (type)
|
||||
{
|
||||
case WS_EVT_CONNECT:
|
||||
LOG_DEBUG("WS client IP[", client->remoteIP().toString().c_str(), "]-ID[", client->id(), "] CONNECTED");
|
||||
LOG_DEBUG("WS client IP [", client->remoteIP().toString().c_str(), "]-ID [", client->id(), "] CONNECTED");
|
||||
break;
|
||||
case WS_EVT_DISCONNECT:
|
||||
LOG_DEBUG("WS client IP[", client->remoteIP().toString().c_str(), "]-ID[", client->id(), "] DISCONNECTED");
|
||||
LOG_DEBUG("WS client IP [", client->remoteIP().toString().c_str(), "]-ID [", client->id(), "] DISCONNECTED");
|
||||
break;
|
||||
case WS_EVT_PONG:
|
||||
LOG_DEBUG("WS client IP[", client->remoteIP().toString().c_str(), "]-ID[", client->id(), "] PONG");
|
||||
LOG_DEBUG("WS client IP [", client->remoteIP().toString().c_str(), "]-ID [", client->id(), "] PONG");
|
||||
break;
|
||||
case WS_EVT_DATA:
|
||||
{
|
||||
|
||||
@@ -35,7 +35,8 @@ private:
|
||||
void onSetTme(const ArduinoJson::JsonDocument &doc);
|
||||
|
||||
private:
|
||||
const uint8_t m_port = 80;
|
||||
const uint8_t c_port = 80;
|
||||
const uint32_t c_pingTime = 5000;
|
||||
fs::FS &m_filesystem;
|
||||
AsyncWebServer m_webserver;
|
||||
AsyncWebSocket m_websocket;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,188 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Astro Rotax Monitor</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header class="page-header">
|
||||
<div class="header-content">
|
||||
<img src="logo_astro_dev.svg" alt="Astro Tecnologie" class="logo">
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<h1>Rotax Ignition Box Monitor</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div id="loadingIndicator" class="loading-indicator">
|
||||
<span class="spinner"></span> Waiting for data...
|
||||
</div>
|
||||
|
||||
<div class="tables-container">
|
||||
<div class="box">
|
||||
<h2>Box_A</h2>
|
||||
<div class="box-data">
|
||||
<p><strong>Timestamp:</strong> <span id="a_timestamp">-</span></p>
|
||||
<p><strong>Data Valid:</strong> <span id="a_datavalid">-</span></p>
|
||||
<p><strong>Generator voltage:</strong> <span id="a_volts_gen">-</span></p>
|
||||
<p><strong>ADC read time:</strong> <span id="a_adc_read_time">-</span></p>
|
||||
<p><strong>Queue errors:</strong> <span id="a_n_queue_errors">-</span></p>
|
||||
</div>
|
||||
<div class="rpm-highlight">
|
||||
<strong>Engine RPM:</strong> <span id="a_eng_rpm">-</span>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Pickup 12</th>
|
||||
<th>Pickup 34</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Spark delay</td>
|
||||
<td id="a_coils12_spark_delay">-</td>
|
||||
<td id="a_coils34_spark_delay">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Spark status</td>
|
||||
<td id="a_coils12_spark_status">-</td>
|
||||
<td id="a_coils34_spark_status">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Soft start status</td>
|
||||
<td id="a_coils12_sstart_status">-</td>
|
||||
<td id="a_coils34_sstart_status">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak P in</td>
|
||||
<td id="a_coils12_peak_p_in">-</td>
|
||||
<td id="a_coils34_peak_p_in">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak N in</td>
|
||||
<td id="a_coils12_peak_n_in">-</td>
|
||||
<td id="a_coils34_peak_n_in">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak P out</td>
|
||||
<td id="a_coils12_peak_p_out">-</td>
|
||||
<td id="a_coils34_peak_p_out">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak N out</td>
|
||||
<td id="a_coils12_peak_n_out">-</td>
|
||||
<td id="a_coils34_peak_n_out">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Level spark</td>
|
||||
<td id="a_coils12_level_spark">-</td>
|
||||
<td id="a_coils34_level_spark">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Spark Events</td>
|
||||
<td id="a_coils12_n_events">-</td>
|
||||
<td id="a_coils34_n_events">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Missed Events</td>
|
||||
<td id="a_coils12_n_missed_firing">-</td>
|
||||
<td id="a_coils34_n_missed_firing">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h2>Box_B</h2>
|
||||
<div class="box-data">
|
||||
<p><strong>Timestamp:</strong> <span id="b_timestamp">-</span></p>
|
||||
<p><strong>Data Valid:</strong> <span id="b_datavalid">-</span></p>
|
||||
<p><strong>Generator voltage:</strong> <span id="b_volts_gen">-</span></p>
|
||||
<p><strong>ADC read time:</strong> <span id="b_adc_read_time">-</span></p>
|
||||
<p><strong>Queue errors:</strong> <span id="b_n_queue_errors">-</span></p>
|
||||
</div>
|
||||
<div class="rpm-highlight">
|
||||
<strong>Engine RPM:</strong> <span id="b_eng_rpm">-</span>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Pickup 12</th>
|
||||
<th>Pickup 34</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Spark delay</td>
|
||||
<td id="b_coils12_spark_delay">-</td>
|
||||
<td id="b_coils34_spark_delay">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Spark status</td>
|
||||
<td id="b_coils12_spark_status">-</td>
|
||||
<td id="b_coils34_spark_status">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Soft start status</td>
|
||||
<td id="b_coils12_sstart_status">-</td>
|
||||
<td id="b_coils34_sstart_status">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak P in</td>
|
||||
<td id="b_coils12_peak_p_in">-</td>
|
||||
<td id="b_coils34_peak_p_in">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak N in</td>
|
||||
<td id="b_coils12_peak_n_in">-</td>
|
||||
<td id="b_coils34_peak_n_in">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak P out</td>
|
||||
<td id="b_coils12_peak_p_out">-</td>
|
||||
<td id="b_coils34_peak_p_out">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peak N out</td>
|
||||
<td id="b_coils12_peak_n_out">-</td>
|
||||
<td id="b_coils34_peak_n_out">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Level spark</td>
|
||||
<td id="b_coils12_level_spark">-</td>
|
||||
<td id="b_coils34_level_spark">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Spark Events</td>
|
||||
<td id="b_coils12_n_events">-</td>
|
||||
<td id="b_coils34_n_events">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Missed Events</td>
|
||||
<td id="b_coils12_n_missed_firing">-</td>
|
||||
<td id="b_coils34_n_missed_firing">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="upload-section">
|
||||
<h3>Upload file to Flash</h3>
|
||||
<p>Select a file and upload it to Flash.</p>
|
||||
<input type="file" id="littlefsFile">
|
||||
<button onclick="uploadLittleFS()">Upload</button>
|
||||
<div id="uploadStatus" class="upload-status">No file uploaded yet.</div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,306 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="e_astro_logo_negativo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
x="0px" y="0px" viewBox="0 0 374 56" style="enable-background:new 0 0 374 56;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<g>
|
||||
<polygon class="st0" points="53.9,46 59.2,46 59.2,44.8 55.3,44.8 55.3,42.4 59,42.4 59,41.2 55.3,41.2 55.3,38.8 59.2,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1.1c0.5,0.2,1,0.4,1.5,0.4c0.6,0,1.1-0.1,1.5-0.4c0.5-0.2,0.8-0.6,1.1-1.1
|
||||
c0.3-0.5,0.4-1.1,0.4-1.8c0-0.7-0.1-1.4-0.4-1.9C94,40.5,93.6,40.1,93.1,39.9z M93,44c-0.1,0.3-0.3,0.6-0.6,0.7
|
||||
c-0.3,0.2-0.5,0.2-0.9,0.2c-0.5,0-0.9-0.2-1.2-0.5C90.1,44,90,43.5,90,42.9c0-0.5,0.1-0.9,0.2-1.2c0.1-0.3,0.3-0.6,0.6-0.7
|
||||
c0.3-0.2,0.5-0.2,0.9-0.2c0.5,0,0.9,0.2,1.2,0.5c0.3,0.4,0.4,0.9,0.4,1.6C93.2,43.3,93.2,43.7,93,44z"/>
|
||||
<path class="st0" d="M101.2,39.9c-0.4-0.2-0.8-0.3-1.3-0.3c-0.5,0-1,0.1-1.3,0.4c-0.3,0.2-0.5,0.5-0.7,0.9l-0.2-1.1h-1.2V46h1.4
|
||||
v-2.9c0-0.5,0.1-0.9,0.2-1.3c0.1-0.4,0.3-0.6,0.6-0.8c0.2-0.2,0.5-0.3,0.9-0.3c0.4,0,0.7,0.1,1,0.4c0.2,0.3,0.4,0.6,0.4,1.2V46h1.4
|
||||
v-3.7c0-0.6-0.1-1.1-0.3-1.5C101.8,40.4,101.5,40.1,101.2,39.9z"/>
|
||||
<rect x="104.7" y="39.7" class="st0" width="1.4" height="6.3"/>
|
||||
<path class="st0" d="M105.4,36.8c-0.3,0-0.5,0.1-0.6,0.2c-0.2,0.1-0.2,0.3-0.2,0.6c0,0.3,0.1,0.5,0.2,0.6c0.2,0.1,0.4,0.2,0.6,0.2
|
||||
c0.3,0,0.5-0.1,0.6-0.2c0.2-0.1,0.2-0.4,0.2-0.6c0-0.2-0.1-0.4-0.2-0.6C105.9,36.9,105.6,36.8,105.4,36.8z"/>
|
||||
<path class="st0" d="M110.3,41c0.2-0.1,0.5-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.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0.4,0,0.7,0.1,1,0.4c0.2,0.3,0.4,0.6,0.4,1.2V46h1.4
|
||||
v-3.7c0-0.6-0.1-1.1-0.3-1.5C158.5,40.4,158.2,40.1,157.9,39.9z"/>
|
||||
<path class="st0" d="M166.7,37c-0.3,0-0.7,0.1-0.9,0.2c-0.3,0.1-0.5,0.3-0.7,0.6c-0.2,0.3-0.3,0.6-0.3,1.1v0.8h-1v0.9h1V46h1.4
|
||||
v-5.4h1.2v-0.9h-1.2v-0.8c0-0.2,0-0.4,0.1-0.5c0.1-0.1,0.2-0.2,0.3-0.3c0.1,0,0.2-0.1,0.4-0.1c0.1,0,0.2,0,0.3,0
|
||||
c0.1,0,0.2,0.1,0.3,0.1l0.3-1.1c-0.2,0-0.4-0.1-0.6-0.1C167.1,37,166.9,37,166.7,37z"/>
|
||||
<path class="st0" d="M173.1,39.9c-0.5-0.2-1-0.4-1.5-0.4c-0.6,0-1.1,0.1-1.5,0.4c-0.5,0.2-0.8,0.6-1.1,1.1
|
||||
c-0.3,0.5-0.4,1.1-0.4,1.9c0,0.7,0.1,1.3,0.4,1.8c0.3,0.5,0.6,0.9,1.1,1.1c0.5,0.2,1,0.4,1.5,0.4c0.6,0,1.1-0.1,1.5-0.4
|
||||
c0.5-0.2,0.8-0.6,1.1-1.1c0.3-0.5,0.4-1.1,0.4-1.8c0-0.7-0.1-1.4-0.4-1.9C173.9,40.5,173.6,40.1,173.1,39.9z M173,44
|
||||
c-0.1,0.3-0.3,0.6-0.6,0.7c-0.3,0.2-0.5,0.2-0.9,0.2c-0.5,0-0.9-0.2-1.2-0.5c-0.3-0.4-0.4-0.9-0.4-1.6c0-0.5,0.1-0.9,0.2-1.2
|
||||
c0.1-0.3,0.3-0.6,0.6-0.7c0.3-0.2,0.5-0.2,0.9-0.2c0.5,0,0.9,0.2,1.2,0.5c0.3,0.4,0.4,0.9,0.4,1.6C173.2,43.3,173.2,43.7,173,44z"
|
||||
/>
|
||||
<path class="st0" d="M179.6,39.6c-0.4,0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,215.3,36.8z"/>
|
||||
<rect x="214.6" y="39.7" class="st0" width="1.4" height="6.3"/>
|
||||
<path class="st0" d="M222.6,39.8c-0.4-0.2-0.9-0.3-1.4-0.3c-0.6,0-1.1,0.1-1.5,0.2c-0.4,0.1-0.7,0.4-1,0.6
|
||||
c-0.2,0.3-0.3,0.7-0.3,1.2h1.5c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.3-0.3,0.5-0.3c0.2-0.1,0.4-0.1,0.7-0.1c0.4,0,0.8,0.1,1,0.3
|
||||
c0.2,0.2,0.3,0.6,0.3,1.1v0.7c-0.3-0.1-0.5-0.1-0.8-0.2c-0.3-0.1-0.6-0.1-1-0.1c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.1-0.7,0.3-0.9,0.6
|
||||
c-0.2,0.3-0.3,0.6-0.3,1c0,0.3,0.1,0.7,0.3,1c0.2,0.3,0.4,0.6,0.8,0.7c0.4,0.2,0.8,0.3,1.3,0.3c0.5,0,0.9-0.1,1.2-0.3
|
||||
c0.3-0.2,0.6-0.5,0.7-0.9l0.1,1h1.2v-4c0-0.6-0.1-1-0.3-1.4C223.3,40.2,223,39.9,222.6,39.8z M222.5,43.7c0,0.2-0.1,0.4-0.2,0.7
|
||||
c-0.1,0.2-0.3,0.4-0.5,0.5c-0.2,0.1-0.5,0.2-0.8,0.2c-0.4,0-0.8-0.1-1-0.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.6,0.4-0.7
|
||||
c0.2-0.1,0.6-0.2,0.9-0.2c0.3,0,0.5,0,0.8,0.1c0.2,0,0.5,0.1,0.7,0.2V43.7z"/>
|
||||
<rect x="226.2" y="37.1" class="st0" width="1.4" height="8.9"/>
|
||||
<polygon class="st0" points="233.3,46 238.7,46 238.7,44.8 234.7,44.8 234.7,42.4 238.4,42.4 238.4,41.2 234.7,41.2 234.7,38.8
|
||||
238.7,38.8 238.7,37.6 233.3,37.6 "/>
|
||||
<path class="st0" d="M246.4,47.6c-0.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class="st0" d="M257.7,36.8c-0.3,0-0.5,0.1-0.6,0.2c-0.2,0.1-0.2,0.3-0.2,0.6c0,0.3,0.1,0.5,0.2,0.6c0.2,0.1,0.4,0.2,0.6,0.2
|
||||
c0.3,0,0.5-0.1,0.6-0.2c0.2-0.1,0.2-0.4,0.2-0.6c0-0.2-0.1-0.4-0.2-0.6C258.2,36.9,258,36.8,257.7,36.8z"/>
|
||||
<rect x="257" y="39.7" class="st0" width="1.4" height="6.3"/>
|
||||
<path class="st0" d="M265.6,39.9c-0.4-0.3-0.9-0.4-1.4-0.4c-0.4,0-0.8,0.1-1.1,0.3c-0.3,0.2-0.5,0.4-0.7,0.8l-0.1-0.9h-1.1v9.4h1.4
|
||||
v-3.7c0.1,0.2,0.3,0.3,0.5,0.5c0.3,0.2,0.7,0.3,1.2,0.3c0.5,0,1-0.1,1.4-0.4c0.4-0.3,0.8-0.6,1.1-1.1c0.3-0.5,0.4-1.1,0.4-1.8
|
||||
c0-0.7-0.1-1.3-0.4-1.8C266.4,40.6,266,40.2,265.6,39.9z M265.4,44c-0.2,0.3-0.4,0.5-0.6,0.7c-0.3,0.2-0.5,0.2-0.8,0.2
|
||||
c-0.3,0-0.5-0.1-0.7-0.2c-0.2-0.1-0.4-0.3-0.6-0.5c-0.1-0.2-0.2-0.5-0.2-0.8v-1.1c0-0.3,0.1-0.6,0.2-0.9c0.1-0.2,0.3-0.4,0.6-0.5
|
||||
c0.2-0.1,0.5-0.2,0.8-0.2c0.3,0,0.6,0.1,0.9,0.2c0.3,0.2,0.5,0.4,0.6,0.7c0.1,0.3,0.2,0.7,0.2,1.1C265.6,43.3,265.6,43.7,265.4,44z
|
||||
"/>
|
||||
<path class="st0" d="M277.9,39.9c-0.3-0.2-0.8-0.3-1.3-0.3c-0.4,0-0.7,0.1-1,0.2c-0.3,0.1-0.6,0.3-0.8,0.6
|
||||
c-0.1,0.2-0.2,0.4-0.3,0.6c0,0,0-0.1,0-0.1c-0.2-0.4-0.4-0.7-0.8-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0.2,0.6c0,0.2,0,0.3,0,0.5H282z"/>
|
||||
<path class="st0" d="M292.8,39.9c-0.3-0.2-0.8-0.3-1.3-0.3c-0.5,0-1,0.1-1.3,0.4c-0.3,0.2-0.5,0.5-0.7,0.9l-0.2-1.1h-1.2V46h1.4
|
||||
v-2.9c0-0.5,0.1-0.9,0.2-1.3c0.1-0.4,0.3-0.6,0.6-0.8c0.2-0.2,0.5-0.3,0.9-0.3c0.4,0,0.7,0.1,1,0.4c0.2,0.3,0.4,0.6,0.4,1.2V46h1.4
|
||||
v-3.7c0-0.6-0.1-1.1-0.3-1.5C293.4,40.4,293.2,40.1,292.8,39.9z"/>
|
||||
<path class="st0" d="M298.9,45c-0.2,0-0.3,0.1-0.5,0.1c-0.5,0-0.8-0.3-0.8-0.8v-3.6h1.8v-0.9h-1.8V38h-1.4v1.7h-0.9v0.9h0.9v3.7
|
||||
c0,0.4,0.1,0.8,0.3,1.1c0.2,0.3,0.4,0.5,0.7,0.6c0.3,0.1,0.6,0.2,1,0.2c0.2,0,0.5,0,0.7-0.1c0.2-0.1,0.5-0.1,0.7-0.2l-0.2-1
|
||||
C299.3,44.9,299.1,45,298.9,45z"/>
|
||||
<path class="st0" d="M58.3,21.7H65l1.3,4h3.1L63.5,8.1h-3.6l-6,17.5H57L58.3,21.7z M61.7,11.6l2.6,7.9h-5.2L61.7,11.6z"/>
|
||||
<path class="st0" d="M80.4,23.1c-0.5,0.2-1.2,0.3-1.9,0.3c-0.7,0-1.3-0.1-1.9-0.3c-0.6-0.2-1.1-0.6-1.4-1c-0.4-0.5-0.5-1.1-0.5-1.8
|
||||
h-2.8c0,1.3,0.4,2.4,1,3.2c0.6,0.9,1.4,1.5,2.4,1.9c1,0.4,2.1,0.6,3.3,0.6c1.4,0,2.7-0.2,3.7-0.6c1-0.4,1.8-1,2.3-1.8
|
||||
c0.5-0.8,0.8-1.7,0.8-2.7c0-1.2-0.4-2.1-1.1-2.9c-0.7-0.8-1.7-1.4-3-1.9l-3.8-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.1C121.6,23.3,122.5,24.3,123.7,25z M124.2,12.1c0.9-1.1,2-1.7,3.5-1.7c1.5,0,2.7,0.6,3.5,1.7s1.3,2.7,1.3,4.8
|
||||
c0,2.1-0.4,3.7-1.3,4.8c-0.9,1.1-2.1,1.7-3.5,1.7c-1.5,0-2.6-0.6-3.5-1.7c-0.9-1.1-1.3-2.7-1.3-4.8
|
||||
C122.9,14.8,123.4,13.2,124.2,12.1z"/>
|
||||
<polygon class="st0" points="149.4,25.6 152.3,25.6 152.3,10.6 157.8,10.6 157.8,8.1 143.9,8.1 143.9,10.6 149.4,10.6 "/>
|
||||
<polygon class="st0" points="171.6,23.1 163.4,23.1 163.4,18.1 171.1,18.1 171.1,15.6 163.4,15.6 163.4,10.6 171.6,10.6 171.6,8.1
|
||||
160.5,8.1 160.5,25.6 171.6,25.6 "/>
|
||||
<path class="st0" d="M178.6,24.9c1.1,0.7,2.5,1.1,4,1.1c1.4,0,2.7-0.2,3.7-0.7c1-0.5,1.8-1.2,2.4-2.1c0.6-0.9,0.8-2,0.8-3.3h-3.1
|
||||
c0,1-0.3,1.8-1,2.5c-0.7,0.6-1.6,1-2.8,1c-1,0-1.8-0.3-2.4-0.8c-0.7-0.5-1.2-1.3-1.5-2.3c-0.3-1-0.5-2.1-0.5-3.4
|
||||
c0-1.4,0.2-2.6,0.6-3.6c0.4-1,0.9-1.7,1.6-2.1c0.7-0.5,1.4-0.7,2.2-0.7c0.9,0,1.7,0.3,2.4,0.9c0.7,0.6,1.1,1.4,1.5,2.3l3.1-0.6
|
||||
c-0.4-1.6-1.1-2.8-2.2-3.8c-1.1-1-2.7-1.5-4.7-1.5c-1.5,0-2.8,0.3-3.9,1c-1.1,0.7-2,1.7-2.7,3c-0.7,1.3-1,3-1,5
|
||||
c0,1.9,0.3,3.5,0.9,4.9C176.6,23.1,177.5,24.1,178.6,24.9z"/>
|
||||
<polygon class="st0" points="196.3,12.7 204.5,25.6 207.5,25.6 207.5,8.1 204.6,8.1 204.6,20.8 196.6,8.1 193.4,8.1 193.4,25.6
|
||||
196.3,25.6 "/>
|
||||
<path class="st0" d="M215.2,25c1.2,0.7,2.5,1,4.1,1c1.5,0,2.9-0.3,4.1-1c1.2-0.7,2.1-1.7,2.8-3c0.7-1.4,1-3.1,1-5.1
|
||||
c0-2-0.3-3.7-1-5c-0.7-1.3-1.6-2.4-2.8-3c-1.2-0.7-2.5-1-4.1-1c-1.5,0-2.9,0.3-4.1,1c-1.2,0.7-2.1,1.7-2.8,3c-0.7,1.3-1,3-1,5.1
|
||||
c0,2,0.3,3.7,1,5.1C213.1,23.3,214,24.3,215.2,25z M215.7,12.1c0.9-1.1,2-1.7,3.5-1.7c1.5,0,2.7,0.6,3.5,1.7
|
||||
c0.9,1.1,1.3,2.7,1.3,4.8c0,2.1-0.4,3.7-1.3,4.8c-0.9,1.1-2.1,1.7-3.5,1.7c-1.5,0-2.6-0.6-3.5-1.7c-0.9-1.1-1.3-2.7-1.3-4.8
|
||||
C214.4,14.8,214.9,13.2,215.7,12.1z"/>
|
||||
<polygon class="st0" points="241.3,23.1 233.9,23.1 233.9,8.1 231,8.1 231,25.6 241.3,25.6 "/>
|
||||
<path class="st0" d="M246.8,25c1.2,0.7,2.5,1,4.1,1c1.5,0,2.9-0.3,4.1-1c1.2-0.7,2.1-1.7,2.8-3c0.7-1.4,1-3.1,1-5.1
|
||||
c0-2-0.3-3.7-1-5c-0.7-1.3-1.6-2.4-2.8-3c-1.2-0.7-2.5-1-4.1-1c-1.5,0-2.9,0.3-4.1,1c-1.2,0.7-2.1,1.7-2.8,3c-0.7,1.3-1,3-1,5.1
|
||||
c0,2,0.3,3.7,1,5.1C244.7,23.3,245.6,24.3,246.8,25z M247.3,12.1c0.9-1.1,2-1.7,3.5-1.7c1.5,0,2.7,0.6,3.5,1.7
|
||||
c0.9,1.1,1.3,2.7,1.3,4.8c0,2.1-0.4,3.7-1.3,4.8c-0.9,1.1-2.1,1.7-3.5,1.7c-1.5,0-2.6-0.6-3.5-1.7c-0.9-1.1-1.3-2.7-1.3-4.8
|
||||
C246,14.8,246.4,13.2,247.3,12.1z"/>
|
||||
<path class="st0" d="M265.1,24.9c1.2,0.7,2.4,1.1,3.8,1.1c1.2,0,2.1-0.3,2.9-0.9c0.7-0.6,1.2-1.4,1.6-2.4l0.3,2.9h2.4v-8.9h-6.9
|
||||
v1.9l4.1,0.1v0.1c0,1-0.2,1.8-0.5,2.5c-0.4,0.7-0.8,1.2-1.5,1.5c-0.6,0.4-1.3,0.5-2.1,0.5c-0.9,0-1.8-0.3-2.5-0.8
|
||||
c-0.7-0.5-1.3-1.3-1.7-2.2c-0.4-1-0.6-2.1-0.6-3.3c0-1.4,0.2-2.5,0.7-3.5c0.5-1,1.1-1.7,1.8-2.3c0.8-0.5,1.6-0.8,2.5-0.8
|
||||
c0.8,0,1.5,0.2,2.1,0.6c0.6,0.4,1.2,1,1.7,1.7l2.9-0.7c-0.7-1.4-1.5-2.5-2.6-3.2c-1.1-0.7-2.4-1-4-1c-1.2,0-2.2,0.2-3.2,0.6
|
||||
c-1,0.4-1.9,1-2.6,1.8c-0.8,0.8-1.3,1.8-1.8,2.9c-0.4,1.1-0.6,2.4-0.6,3.9c0,1.8,0.3,3.4,1,4.7C263,23.1,263.9,24.1,265.1,24.9z"/>
|
||||
<rect x="280.8" y="8.1" class="st0" width="2.9" height="17.5"/>
|
||||
<polygon class="st0" points="300,23.1 291.8,23.1 291.8,18.1 299.5,18.1 299.5,15.6 291.8,15.6 291.8,10.6 300,10.6 300,8.1
|
||||
288.9,8.1 288.9,25.6 300,25.6 "/>
|
||||
<path class="st0" d="M40.6,6.7H0v40.6h40.6V32.2H300v-1.2H40.6V6.7z M7.9,36.7H3.3c-0.4,0-0.7-0.3-0.7-0.7c0-0.4,0.3-0.7,0.7-0.7
|
||||
h4.7c0.4,0,0.7,0.3,0.7,0.7C8.7,36.4,8.3,36.7,7.9,36.7z M7.9,32.2H3.3c-0.4,0-0.7-0.3-0.7-0.7c0-0.4,0.3-0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0.7,0.7C38.1,18.4,37.7,18.8,37.3,18.8z"/>
|
||||
<path class="st0" d="M360.9,50.7v0.7c0.3,0,0.6-0.1,0.9-0.3v4.6h0.7v-5.3h-0.5C361.6,50.5,361.3,50.7,360.9,50.7z"/>
|
||||
<rect x="341" y="52.9" class="st0" width="2.3" height="0.6"/>
|
||||
<path class="st0" d="M332.1,50.4c-0.3-0.1-0.5-0.2-0.8-0.2c-0.6,0-1,0.1-1.3,0.4c-0.3,0.3-0.5,0.7-0.5,1.2c0,0.5,0.2,0.9,0.5,1.2
|
||||
c0.3,0.3,0.7,0.5,1.1,0.5c0.4,0,0.8-0.1,1.1-0.3c0.3-0.2,0.4-0.6,0.5-1c0,0.2,0,0.4,0,0.6c0,1.1-0.3,1.9-0.8,2.2
|
||||
c-0.2,0.1-0.4,0.2-0.7,0.2c-0.3,0-0.5-0.1-0.7-0.3c-0.2-0.2-0.3-0.4-0.3-0.8h-0.7c0,0.5,0.2,0.9,0.5,1.2c0.3,0.3,0.8,0.5,1.4,0.5
|
||||
c0.3,0,0.6-0.1,0.9-0.2c0.8-0.4,1.2-1.3,1.2-2.7c0-0.8-0.2-1.4-0.6-1.9C332.6,50.7,332.3,50.5,332.1,50.4z M332,52.6
|
||||
c-0.2,0.2-0.5,0.3-0.8,0.3s-0.6-0.1-0.8-0.3c-0.2-0.2-0.3-0.4-0.3-0.8c0-0.3,0.1-0.6,0.3-0.8c0.2-0.2,0.5-0.3,0.8-0.3
|
||||
c0.3,0,0.6,0.1,0.8,0.3c0.2,0.2,0.3,0.4,0.3,0.7C332.3,52.2,332.2,52.4,332,52.6z"/>
|
||||
<path class="st0" d="M347,54.2c0.1-0.1,0.3-0.3,0.6-0.4l1.1-0.4c0.4-0.2,0.7-0.4,0.9-0.6c0.2-0.3,0.3-0.6,0.3-1
|
||||
c0-0.4-0.2-0.8-0.5-1.1c-0.3-0.3-0.8-0.4-1.3-0.4c-0.5,0-1,0.1-1.3,0.4c-0.3,0.2-0.5,0.6-0.6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-0.6-2C354.2,50.5,353.7,50.2,353.1,50.2z M354.1,54.6
|
||||
c-0.2,0.4-0.6,0.6-1,0.6c-0.5,0-0.8-0.2-1-0.6c-0.2-0.4-0.4-0.9-0.4-1.6c0-0.7,0.1-1.2,0.4-1.6c0.2-0.4,0.6-0.6,1-0.6
|
||||
c0.5,0,0.8,0.2,1,0.6c0.2,0.4,0.4,0.9,0.4,1.6C354.5,53.7,354.3,54.2,354.1,54.6z"/>
|
||||
<path class="st0" d="M327.1,50.4c-0.3-0.1-0.5-0.2-0.8-0.2c-0.6,0-1,0.1-1.3,0.4c-0.3,0.3-0.5,0.7-0.5,1.2c0,0.5,0.2,0.9,0.5,1.2
|
||||
c0.3,0.3,0.7,0.5,1.1,0.5c0.4,0,0.8-0.1,1.1-0.3c0.3-0.2,0.4-0.6,0.5-1c0,0.2,0,0.4,0,0.6c0,1.1-0.3,1.9-0.8,2.2
|
||||
c-0.2,0.1-0.4,0.2-0.7,0.2c-0.3,0-0.5-0.1-0.7-0.3c-0.2-0.2-0.3-0.4-0.3-0.8h-0.7c0,0.5,0.2,0.9,0.5,1.2c0.3,0.3,0.8,0.5,1.4,0.5
|
||||
c0.3,0,0.6-0.1,0.9-0.2c0.8-0.4,1.2-1.3,1.2-2.7c0-0.8-0.2-1.4-0.6-1.9C327.6,50.7,327.4,50.5,327.1,50.4z M327.1,52.6
|
||||
c-0.2,0.2-0.5,0.3-0.8,0.3c-0.3,0-0.6-0.1-0.8-0.3c-0.2-0.2-0.3-0.4-0.3-0.8c0-0.3,0.1-0.6,0.3-0.8c0.2-0.2,0.5-0.3,0.8-0.3
|
||||
c0.3,0,0.6,0.1,0.8,0.3c0.2,0.2,0.3,0.4,0.3,0.7C327.4,52.2,327.3,52.4,327.1,52.6z"/>
|
||||
<path class="st0" d="M321.5,50.7v0.7c0.3,0,0.6-0.1,0.9-0.3v4.6h0.7v-5.3h-0.5C322.3,50.5,321.9,50.7,321.5,50.7z"/>
|
||||
<path class="st0" d="M357,54.2c0.1-0.1,0.3-0.3,0.6-0.4l1.1-0.4c0.4-0.2,0.7-0.4,0.9-0.6c0.2-0.3,0.3-0.6,0.3-1
|
||||
c0-0.4-0.2-0.8-0.5-1.1c-0.3-0.3-0.8-0.4-1.3-0.4c-0.5,0-1,0.1-1.3,0.4c-0.3,0.2-0.5,0.6-0.6,1.1h0.7c0-0.3,0.2-0.5,0.4-0.6
|
||||
c0.2-0.1,0.5-0.2,0.8-0.2c0.3,0,0.6,0.1,0.8,0.3c0.2,0.2,0.3,0.4,0.3,0.7c0,0.5-0.3,0.8-0.8,1.1l-1.1,0.4c-0.2,0.1-0.4,0.2-0.5,0.3
|
||||
c-0.5,0.3-0.7,0.8-0.7,1.4v0.8h3.8V55h-3.1v-0.3C356.8,54.5,356.9,54.4,357,54.2z"/>
|
||||
<rect x="350.4" y="41" class="st0" width="1" height="5.5"/>
|
||||
<polygon class="st0" points="342.8,46.5 342.8,41 341.8,41 341.8,44.9 339.4,41 338.3,41 338.3,46.5 339.3,46.5 339.3,42.5
|
||||
341.8,46.5 "/>
|
||||
<polygon class="st0" points="348.9,46.5 348.9,41 347.9,41 347.9,44.9 345.4,41 344.4,41 344.4,46.5 345.4,46.5 345.4,42.5
|
||||
347.9,46.5 "/>
|
||||
<path class="st0" d="M336.3,46.5h1.1l-1.8-5.5h-1.3l-1.9,5.5h1.1l0.4-1.2h2L336.3,46.5z M334.1,44.6l0.8-2.4l0.8,2.4H334.1z"/>
|
||||
<path class="st0" d="M373.5,33.6c-0.1-0.1-0.2-0.2-0.3-0.3c-0.1-0.1-0.2-0.2-0.3-0.4c-0.1-0.1-0.3-0.3-0.4-0.4c0,0-0.1-0.1-0.1-0.1
|
||||
c0,0-0.1-0.1-0.1-0.1c-0.1-0.1-0.2-0.2-0.2-0.2c-0.1-0.1-0.2-0.2-0.3-0.2c0,0-0.1-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1
|
||||
c-0.2-0.2-0.4-0.3-0.6-0.5c-0.2-0.2-0.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.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.2,0.1,0.3,0.2c0.1,0.1,0.2,0.1,0.3,0.2
|
||||
c0,0,0.1,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1c0.2,0.1,0.3,0.2,0.5,0.3c0.2,0.1,0.3,0.2,0.4,0.3c0.1,0.1,0.2,0.2,0.3,0.2
|
||||
c0.4,0.3,0.6,0.4,0.6,0.4C374,34.2,373.8,34,373.5,33.6z M335.8,24.8c2.6-2.7,4.4-5,5.4-7c0.2-0.4,0.4-0.9,0.6-1.3l3.6,0.8
|
||||
c0.6-0.6,1.1-1,1.7-1.3c0.6-0.3,1.2-0.4,1.8-0.4c1.1,0,2.1,0.4,2.9,1.3c0.8,0.9,1.2,1.9,1.2,3.3c0,1.4-0.4,2.5-1.3,3.4
|
||||
c-0.8,0.9-1.9,1.3-3.1,1.3c-0.9,0-1.7-0.2-2.4-0.7c-0.7-0.5-1.3-1.1-1.7-2h-5.7c0.5,2.4,1.7,4.3,3.5,5.7c0.2,0.1,0.3,0.2,0.5,0.4
|
||||
c0,0,0,0,0,0c-0.2,0.1-0.3,0.1-0.5,0.2c0,0,0,0,0,0h-9.6L335.8,24.8z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 31 KiB |
@@ -1,164 +0,0 @@
|
||||
let ws;
|
||||
let lastMessageTimestamp = 0;
|
||||
const IDLE_THRESHOLD_MS = 1000;
|
||||
const loadingIndicator = document.getElementById("loadingIndicator");
|
||||
|
||||
function setLoadingIndicator(visible) {
|
||||
if (!loadingIndicator) {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingIndicator.classList.toggle("hidden", !visible);
|
||||
}
|
||||
|
||||
function updateLoadingState() {
|
||||
const isConnected = ws && ws.readyState === WebSocket.OPEN;
|
||||
const idle = Date.now() - lastMessageTimestamp >= IDLE_THRESHOLD_MS;
|
||||
|
||||
setLoadingIndicator(isConnected && idle);
|
||||
}
|
||||
|
||||
function connectWS() {
|
||||
ws = new WebSocket("ws://" + location.host + "/ws");
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connesso");
|
||||
lastMessageTimestamp = Date.now();
|
||||
setLoadingIndicator(false);
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
console.log("WebSocket disconnesso, retry...");
|
||||
setLoadingIndicator(false);
|
||||
setTimeout(connectWS, 5000);
|
||||
};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
let data;
|
||||
|
||||
try {
|
||||
data = JSON.parse(event.data);
|
||||
} catch (e) {
|
||||
console.error("Invalid JSON received", e);
|
||||
return;
|
||||
}
|
||||
|
||||
lastMessageTimestamp = Date.now();
|
||||
setLoadingIndicator(false);
|
||||
|
||||
// Update Box_A
|
||||
if (data.box_a) {
|
||||
const boxA = data.box_a;
|
||||
document.getElementById("a_datavalid").textContent = boxA.datavalid ?? "-";
|
||||
document.getElementById("a_timestamp").textContent = boxA.timestamp ?? "-";
|
||||
document.getElementById("a_volts_gen").textContent = boxA.volts_gen ?? "-";
|
||||
document.getElementById("a_eng_rpm").textContent = boxA.eng_rpm ?? "-";
|
||||
document.getElementById("a_adc_read_time").textContent = boxA.adc_read_time ?? "-";
|
||||
document.getElementById("a_n_queue_errors").textContent = boxA.n_queue_errors ?? "-";
|
||||
|
||||
const coils12A = boxA.coils12 || {};
|
||||
const coils34A = boxA.coils34 || {};
|
||||
|
||||
document.getElementById("a_coils12_spark_delay").textContent = coils12A.spark_delay ?? "-";
|
||||
document.getElementById("a_coils34_spark_delay").textContent = coils34A.spark_delay ?? "-";
|
||||
document.getElementById("a_coils12_spark_status").textContent = coils12A.spark_status ?? "-";
|
||||
document.getElementById("a_coils34_spark_status").textContent = coils34A.spark_status ?? "-";
|
||||
document.getElementById("a_coils12_sstart_status").textContent = coils12A.sstart_status ?? "-";
|
||||
document.getElementById("a_coils34_sstart_status").textContent = coils34A.sstart_status ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_in").textContent = coils12A.peak_p_in ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_in").textContent = coils34A.peak_p_in ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_in").textContent = coils12A.peak_n_in ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_in").textContent = coils34A.peak_n_in ?? "-";
|
||||
document.getElementById("a_coils12_peak_p_out").textContent = coils12A.peak_p_out ?? "-";
|
||||
document.getElementById("a_coils34_peak_p_out").textContent = coils34A.peak_p_out ?? "-";
|
||||
document.getElementById("a_coils12_peak_n_out").textContent = coils12A.peak_n_out ?? "-";
|
||||
document.getElementById("a_coils34_peak_n_out").textContent = coils34A.peak_n_out ?? "-";
|
||||
document.getElementById("a_coils12_level_spark").textContent = coils12A.level_spark ?? "-";
|
||||
document.getElementById("a_coils34_level_spark").textContent = coils34A.level_spark ?? "-";
|
||||
document.getElementById("a_coils12_n_events").textContent = coils12A.n_events ?? "-";
|
||||
document.getElementById("a_coils34_n_events").textContent = coils34A.n_events ?? "-";
|
||||
document.getElementById("a_coils12_n_missed_firing").textContent = coils12A.n_missed_firing ?? "-";
|
||||
document.getElementById("a_coils34_n_missed_firing").textContent = coils34A.n_missed_firing ?? "-";
|
||||
}
|
||||
|
||||
// Update Box_B
|
||||
if (data.box_b) {
|
||||
const boxB = data.box_b;
|
||||
document.getElementById("b_datavalid").textContent = boxB.datavalid ?? "-";
|
||||
document.getElementById("b_timestamp").textContent = boxB.timestamp ?? "-";
|
||||
document.getElementById("b_volts_gen").textContent = boxB.volts_gen ?? "-";
|
||||
document.getElementById("b_eng_rpm").textContent = boxB.eng_rpm ?? "-";
|
||||
document.getElementById("b_adc_read_time").textContent = boxB.adc_read_time ?? "-";
|
||||
document.getElementById("b_n_queue_errors").textContent = boxB.n_queue_errors ?? "-";
|
||||
|
||||
const coils12B = boxB.coils12 || {};
|
||||
const coils34B = boxB.coils34 || {};
|
||||
|
||||
document.getElementById("b_coils12_spark_delay").textContent = coils12B.spark_delay ?? "-";
|
||||
document.getElementById("b_coils34_spark_delay").textContent = coils34B.spark_delay ?? "-";
|
||||
document.getElementById("b_coils12_spark_status").textContent = coils12B.spark_status ?? "-";
|
||||
document.getElementById("b_coils34_spark_status").textContent = coils34B.spark_status ?? "-";
|
||||
document.getElementById("b_coils12_sstart_status").textContent = coils12B.sstart_status ?? "-";
|
||||
document.getElementById("b_coils34_sstart_status").textContent = coils34B.sstart_status ?? "-";
|
||||
document.getElementById("b_coils12_peak_p_in").textContent = coils12B.peak_p_in ?? "-";
|
||||
document.getElementById("b_coils34_peak_p_in").textContent = coils34B.peak_p_in ?? "-";
|
||||
document.getElementById("b_coils12_peak_n_in").textContent = coils12B.peak_n_in ?? "-";
|
||||
document.getElementById("b_coils34_peak_n_in").textContent = coils34B.peak_n_in ?? "-";
|
||||
document.getElementById("b_coils12_peak_p_out").textContent = coils12B.peak_p_out ?? "-";
|
||||
document.getElementById("b_coils34_peak_p_out").textContent = coils34B.peak_p_out ?? "-";
|
||||
document.getElementById("b_coils12_peak_n_out").textContent = coils12B.peak_n_out ?? "-";
|
||||
document.getElementById("b_coils34_peak_n_out").textContent = coils34B.peak_n_out ?? "-";
|
||||
document.getElementById("b_coils12_level_spark").textContent = coils12B.level_spark ?? "-";
|
||||
document.getElementById("b_coils34_level_spark").textContent = coils34B.level_spark ?? "-";
|
||||
document.getElementById("b_coils12_n_events").textContent = coils12B.n_events ?? "-";
|
||||
document.getElementById("b_coils34_n_events").textContent = coils34B.n_events ?? "-";
|
||||
document.getElementById("b_coils12_n_missed_firing").textContent = coils12B.n_missed_firing ?? "-";
|
||||
document.getElementById("b_coils34_n_missed_firing").textContent = coils34B.n_missed_firing ?? "-";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function start() {
|
||||
fetch("/start");
|
||||
}
|
||||
|
||||
function stop() {
|
||||
fetch("/stop");
|
||||
}
|
||||
|
||||
function uploadLittleFS() {
|
||||
const fileInput = document.getElementById("littlefsFile");
|
||||
const status = document.getElementById("uploadStatus");
|
||||
|
||||
if (!fileInput || fileInput.files.length === 0) {
|
||||
if (status) status.textContent = "Select a file first.";
|
||||
return;
|
||||
}
|
||||
|
||||
const file = fileInput.files[0];
|
||||
const formData = new FormData();
|
||||
formData.append("file", file, file.name);
|
||||
|
||||
if (status) status.textContent = "Uploading...";
|
||||
|
||||
fetch("/upload", {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
})
|
||||
.then((resp) => {
|
||||
if (!resp.ok) {
|
||||
throw new Error("Upload failed: " + resp.status + " " + resp.statusText);
|
||||
}
|
||||
return resp.text();
|
||||
})
|
||||
.then(() => {
|
||||
if (status) status.textContent = "Uploaded: " + file.name;
|
||||
fileInput.value = "";
|
||||
})
|
||||
.catch((err) => {
|
||||
if (status) status.textContent = err.message;
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(updateLoadingState, 200);
|
||||
connectWS();
|
||||
@@ -1,221 +0,0 @@
|
||||
:root {
|
||||
--primary-dark: #0a1929;
|
||||
--primary-blue: #003585;
|
||||
--accent-blue: #1e88e5;
|
||||
--light-bg: #f5f7fa;
|
||||
--border-color: #d0d6dd;
|
||||
--text-dark: #1a1a1a;
|
||||
--text-muted: #666666;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: var(--light-bg);
|
||||
color: var(--text-dark);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
background: linear-gradient(135deg, var(--primary-dark) 0%, #1a3a52 100%);
|
||||
color: white;
|
||||
padding: 30px 20px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 50px;
|
||||
width: auto;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
margin: auto;
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: auto;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
background: white;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 12px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: var(--primary-blue);
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background-color: #f9fbfc;
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 10px;
|
||||
padding: 10px 20px;
|
||||
font-size: 16px;
|
||||
background-color: var(--primary-blue);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.upload-section {
|
||||
margin: 30px auto 20px;
|
||||
max-width: 900px;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
background: white;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.upload-section h3 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
color: var(--primary-blue);
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.upload-section p {
|
||||
margin: 8px 0;
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.upload-section input[type="file"] {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.upload-status {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.loading-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin: 0;
|
||||
padding: 16px 20px;
|
||||
font-size: 20px;
|
||||
color: var(--primary-blue);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
background: white;
|
||||
width: 100%;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.loading-indicator.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid transparent;
|
||||
border-top-color: var(--primary-blue);
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.tables-container {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
max-width: 1800px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.box {
|
||||
flex: 1;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.box h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
color: var(--primary-blue);
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.box-data {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.box-data p {
|
||||
margin: 8px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.box-data strong {
|
||||
color: var(--primary-blue);
|
||||
}
|
||||
|
||||
.rpm-highlight {
|
||||
background: #c6e4fa;
|
||||
border: 3px double var(--primary-blue);
|
||||
border-radius: 8px;
|
||||
padding: 12px 16px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: var(--text-dark);
|
||||
}
|
||||
|
||||
.rpm-highlight strong {
|
||||
color: var(--primary-blue);
|
||||
}
|
||||
|
||||
span {
|
||||
color: var(--text-dark);
|
||||
}
|
||||
Reference in New Issue
Block a user