Compare commits

..

No commits in common. "main" and "pinmap-hdr" have entirely different histories.

5 changed files with 6 additions and 34 deletions

View File

@ -1,28 +0,0 @@
import serial
from datetime import datetime
# Configure serial port settings
port = '/dev/cu.usbmodemNRAQBQER2' # Replace with your specific serial port
baud_rate = 115200 # Replace with the appropriate baud rate
timeout = 1 # Specify the timeout for reading from the serial port
# Open the serial port
ser = serial.Serial(port, baud_rate, timeout=timeout)
# Generate the filename based on current date and time
now = datetime.now()
date_time = now.strftime("%Y-%m-%d_%H-%M")
filename = f"{date_time}_SHOH.txt"
# Open a file to write the logs
with open(filename, 'w') as file:
# Read and write the logs from the serial port
while True:
line = ser.readline().decode().strip()
if line:
file.write(line + '\n')
print(line) # Optional: Print the logs to the console as well
# Close the serial port when done
ser.close()

View File

@ -16,7 +16,7 @@ extern QueueHandle_t logging_queue;
/* ================= Settings ================== */ /* ================= Settings ================== */
#define LOG_COLORED_OUTPUT #define LOG_COLORED_OUTPUT
#define HIGH_PRIORITY_DEBUG #define HIGH_PRIORITY_DEBUG
#define LOG_DEBUG_MESSAGES 0 #define LOG_DEBUG_MESSAGES 1
/* ================= Settings ================== */ /* ================= Settings ================== */
// internal debug defines // internal debug defines

View File

@ -50,7 +50,7 @@ void Master::HandleEventType(Event* e)
//Comes from rotary, goes to manager //Comes from rotary, goes to manager
send = _qm->send<Event>(ThreadCommon::QueueManager::manager_event_master, e, 0); send = _qm->send<Event>(ThreadCommon::QueueManager::manager_event_master, e, 0);
//LOG_WARNING("Timestamp: %zus, Clock: %zu, Chip freq: %zu", LPC_SCT1->COUNT_U / Chip_Clock_GetMainClockRate(), LPC_SCT1->COUNT_U, Chip_Clock_GetMainClockRate()); //LOG_WARNING("Timestamp: %zus, Clock: %zu, Chip freq: %zu", LPC_SCT1->COUNT_U / Chip_Clock_GetMainClockRate(), LPC_SCT1->COUNT_U, Chip_Clock_GetMainClockRate());
if (send) LOG_INFO("Rotary: %s has been forwarded to manager", rotary_direction[rd]); if (send) LOG_DEBUG("Rotary: %s has been forwarded to manager", rotary_direction[rd]);
break; break;
case Event::InternalTemp: case Event::InternalTemp:
// TODO remove (deprecated) // TODO remove (deprecated)

View File

@ -24,10 +24,10 @@ private:
ThreadCommon::PIN_ROTARY_SIG_A, ThreadCommon::PIN_ROTARY_SIG_A,
true, true, false, true, PIN_INT0_IRQn}, true, true, false, true, PIN_INT0_IRQn},
{ ThreadCommon::PORT_ROTARY_SIG_B, { ThreadCommon::PORT_ROTARY_SIG_B,
ThreadCommon::PIN_ROTARY_SIG_B, ThreadCommon::PIN_ROTARY_SIG_A,
true, true, false}, true, true, false},
{ ThreadCommon::PORT_ROTARY_PRESS, { ThreadCommon::PORT_ROTARY_PRESS,
ThreadCommon::PIN_ROTARY_PRESS, ThreadCommon::PIN_ROTARY_SIG_A,
true, true, false, true, PIN_INT1_IRQn} }; true, true, false, true, PIN_INT1_IRQn} };
}; };

View File

@ -20,7 +20,7 @@ void Temperature::taskFunction()
SensorTempSHT20 ext_temp_sensor(this->_pi2c); SensorTempSHT20 ext_temp_sensor(this->_pi2c);
Event t (Event::ExternalTemp, -128); Event t (Event::ExternalTemp, -128);
int8_t temp_value = -128; int8_t temp_value = -128;
while(ext_temp_sensor.is_up() != true); _qm->send<Event>(ThreadCommon::QueueManager::master_event_all, &t, 0);
for (;;) for (;;)
{ {
if (ext_temp_sensor.is_up()) if (ext_temp_sensor.is_up())