mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-30 22:50:57 +00:00
Pass#2: Lots more savings in logs and string reduction surgery (#5251)
* Pass#2: Lots more savings in logs and string reduction surgery * Don't need Thread suffix either * Warn
This commit is contained in:
@@ -46,7 +46,7 @@ void run_codec2(void *parameter)
|
||||
// 4 bytes of header in each frame hex c0 de c2 plus the bitrate
|
||||
memcpy(audioModule->tx_encode_frame, &audioModule->tx_header, sizeof(audioModule->tx_header));
|
||||
|
||||
LOG_INFO("Starting codec2 task");
|
||||
LOG_INFO("Start codec2 task");
|
||||
|
||||
while (true) {
|
||||
uint32_t tcount = ulTaskNotifyTake(pdFALSE, pdMS_TO_TICKS(10000));
|
||||
@@ -61,7 +61,7 @@ void run_codec2(void *parameter)
|
||||
audioModule->tx_encode_frame_index += audioModule->encode_codec_size;
|
||||
|
||||
if (audioModule->tx_encode_frame_index == (audioModule->encode_frame_size + sizeof(audioModule->tx_header))) {
|
||||
LOG_INFO("Sending %d codec2 bytes", audioModule->encode_frame_size);
|
||||
LOG_INFO("Send %d codec2 bytes", audioModule->encode_frame_size);
|
||||
audioModule->sendPayload();
|
||||
audioModule->tx_encode_frame_index = sizeof(audioModule->tx_header);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ void run_codec2(void *parameter)
|
||||
}
|
||||
}
|
||||
|
||||
AudioModule::AudioModule() : SinglePortModule("AudioModule", meshtastic_PortNum_AUDIO_APP), concurrency::OSThread("AudioModule")
|
||||
AudioModule::AudioModule() : SinglePortModule("Audio", meshtastic_PortNum_AUDIO_APP), concurrency::OSThread("Audio")
|
||||
{
|
||||
// moduleConfig.audio.codec2_enabled = true;
|
||||
// moduleConfig.audio.i2s_ws = 13;
|
||||
@@ -101,8 +101,7 @@ AudioModule::AudioModule() : SinglePortModule("AudioModule", meshtastic_PortNum_
|
||||
// moduleConfig.audio.ptt_pin = 39;
|
||||
|
||||
if ((moduleConfig.audio.codec2_enabled) && (myRegion->audioPermitted)) {
|
||||
LOG_INFO("Setting up codec2 in mode %u",
|
||||
(moduleConfig.audio.bitrate ? moduleConfig.audio.bitrate : AUDIO_MODULE_MODE) - 1);
|
||||
LOG_INFO("Set up codec2 in mode %u", (moduleConfig.audio.bitrate ? moduleConfig.audio.bitrate : AUDIO_MODULE_MODE) - 1);
|
||||
codec2 = codec2_create((moduleConfig.audio.bitrate ? moduleConfig.audio.bitrate : AUDIO_MODULE_MODE) - 1);
|
||||
memcpy(tx_header.magic, c2_magic, sizeof(c2_magic));
|
||||
tx_header.mode = (moduleConfig.audio.bitrate ? moduleConfig.audio.bitrate : AUDIO_MODULE_MODE) - 1;
|
||||
@@ -111,7 +110,7 @@ AudioModule::AudioModule() : SinglePortModule("AudioModule", meshtastic_PortNum_
|
||||
encode_frame_num = (meshtastic_Constants_DATA_PAYLOAD_LEN - sizeof(tx_header)) / encode_codec_size;
|
||||
encode_frame_size = encode_frame_num * encode_codec_size; // max 233 bytes + 4 header bytes
|
||||
adc_buffer_size = codec2_samples_per_frame(codec2);
|
||||
LOG_INFO("using %d frames of %d bytes for a total payload length of %d bytes", encode_frame_num, encode_codec_size,
|
||||
LOG_INFO("Use %d frames of %d bytes for a total payload length of %d bytes", encode_frame_num, encode_codec_size,
|
||||
encode_frame_size);
|
||||
xTaskCreate(&run_codec2, "codec2_task", 30000, NULL, 5, &codec2HandlerTask);
|
||||
} else {
|
||||
@@ -148,7 +147,7 @@ int32_t AudioModule::runOnce()
|
||||
esp_err_t res;
|
||||
if (firstTime) {
|
||||
// Set up I2S Processor configuration. This will produce 16bit samples at 8 kHz instead of 12 from the ADC
|
||||
LOG_INFO("Initializing I2S SD: %d DIN: %d WS: %d SCK: %d", moduleConfig.audio.i2s_sd, moduleConfig.audio.i2s_din,
|
||||
LOG_INFO("Init I2S SD: %d DIN: %d WS: %d SCK: %d", moduleConfig.audio.i2s_sd, moduleConfig.audio.i2s_din,
|
||||
moduleConfig.audio.i2s_ws, moduleConfig.audio.i2s_sck);
|
||||
i2s_config_t i2s_config = {.mode = (i2s_mode_t)(I2S_MODE_MASTER | (moduleConfig.audio.i2s_sd ? I2S_MODE_RX : 0) |
|
||||
(moduleConfig.audio.i2s_din ? I2S_MODE_TX : 0)),
|
||||
@@ -185,7 +184,7 @@ int32_t AudioModule::runOnce()
|
||||
radio_state = RadioState::rx;
|
||||
|
||||
// Configure PTT input
|
||||
LOG_INFO("Initializing PTT on Pin %u", moduleConfig.audio.ptt_pin ? moduleConfig.audio.ptt_pin : PTT_PIN);
|
||||
LOG_INFO("Init PTT on Pin %u", moduleConfig.audio.ptt_pin ? moduleConfig.audio.ptt_pin : PTT_PIN);
|
||||
pinMode(moduleConfig.audio.ptt_pin ? moduleConfig.audio.ptt_pin : PTT_PIN, INPUT);
|
||||
|
||||
firstTime = false;
|
||||
@@ -204,7 +203,7 @@ int32_t AudioModule::runOnce()
|
||||
LOG_INFO("PTT released, switching to RX");
|
||||
if (tx_encode_frame_index > sizeof(tx_header)) {
|
||||
// Send the incomplete frame
|
||||
LOG_INFO("Sending %d codec2 bytes (incomplete)", tx_encode_frame_index);
|
||||
LOG_INFO("Send %d codec2 bytes (incomplete)", tx_encode_frame_index);
|
||||
sendPayload();
|
||||
}
|
||||
tx_encode_frame_index = sizeof(tx_header);
|
||||
|
||||
@@ -22,7 +22,7 @@ void PaxcounterModule::handlePaxCounterReportRequest()
|
||||
}
|
||||
|
||||
PaxcounterModule::PaxcounterModule()
|
||||
: concurrency::OSThread("PaxcounterModule"),
|
||||
: concurrency::OSThread("Paxcounter"),
|
||||
ProtobufModule("paxcounter", meshtastic_PortNum_PAXCOUNTER_APP, &meshtastic_Paxcount_msg)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user