remove newline from logging statements. (#5022)

remove newline from logging statements in code. The LOG_* functions will now magically add it at the end.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Thomas Göttgens
2024-10-14 06:11:43 +02:00
committed by GitHub
parent fb9f361052
commit 05e4a639a1
150 changed files with 1816 additions and 1800 deletions

View File

@@ -97,7 +97,7 @@ int32_t ExternalNotificationModule::runOnce()
externalTurnedOn[i] = 0;
LOG_INFO("%d ", i);
}
LOG_INFO("\n");
LOG_INFO("");
#ifdef HAS_I2S
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
// T-Deck uses GPIO0 as trackball button, so restore the mode
@@ -369,34 +369,34 @@ ExternalNotificationModule::ExternalNotificationModule()
sizeof(rtttlConfig.ringtone));
}
LOG_INFO("Initializing External Notification Module\n");
LOG_INFO("Initializing External Notification Module");
output = moduleConfig.external_notification.output ? moduleConfig.external_notification.output
: EXT_NOTIFICATION_MODULE_OUTPUT;
// Set the direction of a pin
if (output > 0) {
LOG_INFO("Using Pin %i in digital mode\n", output);
LOG_INFO("Using Pin %i in digital mode", output);
pinMode(output, OUTPUT);
}
setExternalOff(0);
externalTurnedOn[0] = 0;
if (moduleConfig.external_notification.output_vibra) {
LOG_INFO("Using Pin %i for vibra motor\n", moduleConfig.external_notification.output_vibra);
LOG_INFO("Using Pin %i for vibra motor", moduleConfig.external_notification.output_vibra);
pinMode(moduleConfig.external_notification.output_vibra, OUTPUT);
setExternalOff(1);
externalTurnedOn[1] = 0;
}
if (moduleConfig.external_notification.output_buzzer) {
if (!moduleConfig.external_notification.use_pwm) {
LOG_INFO("Using Pin %i for buzzer\n", moduleConfig.external_notification.output_buzzer);
LOG_INFO("Using Pin %i for buzzer", moduleConfig.external_notification.output_buzzer);
pinMode(moduleConfig.external_notification.output_buzzer, OUTPUT);
setExternalOff(2);
externalTurnedOn[2] = 0;
} else {
config.device.buzzer_gpio = config.device.buzzer_gpio ? config.device.buzzer_gpio : PIN_BUZZER;
// in PWM Mode we force the buzzer pin if it is set
LOG_INFO("Using Pin %i in PWM mode\n", config.device.buzzer_gpio);
LOG_INFO("Using Pin %i in PWM mode", config.device.buzzer_gpio);
}
}
#ifdef HAS_NCP5623
@@ -421,7 +421,7 @@ ExternalNotificationModule::ExternalNotificationModule()
pixels.setBrightness(moduleConfig.ambient_lighting.current);
#endif
} else {
LOG_INFO("External Notification Module Disabled\n");
LOG_INFO("External Notification Module Disabled");
disable();
}
}
@@ -447,7 +447,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
if (moduleConfig.external_notification.alert_bell) {
if (containsBell) {
LOG_INFO("externalNotificationModule - Notification Bell\n");
LOG_INFO("externalNotificationModule - Notification Bell");
isNagging = true;
setExternalOn(0);
if (moduleConfig.external_notification.nag_timeout) {
@@ -460,7 +460,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
if (moduleConfig.external_notification.alert_bell_vibra) {
if (containsBell) {
LOG_INFO("externalNotificationModule - Notification Bell (Vibra)\n");
LOG_INFO("externalNotificationModule - Notification Bell (Vibra)");
isNagging = true;
setExternalOn(1);
if (moduleConfig.external_notification.nag_timeout) {
@@ -473,7 +473,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
if (moduleConfig.external_notification.alert_bell_buzzer) {
if (containsBell) {
LOG_INFO("externalNotificationModule - Notification Bell (Buzzer)\n");
LOG_INFO("externalNotificationModule - Notification Bell (Buzzer)");
isNagging = true;
if (!moduleConfig.external_notification.use_pwm) {
setExternalOn(2);
@@ -493,7 +493,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
if (moduleConfig.external_notification.alert_message) {
LOG_INFO("externalNotificationModule - Notification Module\n");
LOG_INFO("externalNotificationModule - Notification Module");
isNagging = true;
setExternalOn(0);
if (moduleConfig.external_notification.nag_timeout) {
@@ -504,7 +504,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
if (moduleConfig.external_notification.alert_message_vibra) {
LOG_INFO("externalNotificationModule - Notification Module (Vibra)\n");
LOG_INFO("externalNotificationModule - Notification Module (Vibra)");
isNagging = true;
setExternalOn(1);
if (moduleConfig.external_notification.nag_timeout) {
@@ -515,7 +515,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
if (moduleConfig.external_notification.alert_message_buzzer) {
LOG_INFO("externalNotificationModule - Notification Module (Buzzer)\n");
LOG_INFO("externalNotificationModule - Notification Module (Buzzer)");
isNagging = true;
if (!moduleConfig.external_notification.use_pwm && !moduleConfig.external_notification.use_i2s_as_buzzer) {
setExternalOn(2);
@@ -537,7 +537,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
setIntervalFromNow(0); // run once so we know if we should do something
}
} else {
LOG_INFO("External Notification Module Disabled or muted\n");
LOG_INFO("External Notification Module Disabled or muted");
}
return ProcessMessage::CONTINUE; // Let others look at this message also if they want
@@ -560,13 +560,13 @@ AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule
switch (request->which_payload_variant) {
case meshtastic_AdminMessage_get_ringtone_request_tag:
LOG_INFO("Client is getting ringtone\n");
LOG_INFO("Client is getting ringtone");
this->handleGetRingtone(mp, response);
result = AdminMessageHandleResult::HANDLED_WITH_RESPONSE;
break;
case meshtastic_AdminMessage_set_ringtone_message_tag:
LOG_INFO("Client is setting ringtone\n");
LOG_INFO("Client is setting ringtone");
this->handleSetRingtone(request->set_canned_message_module_messages);
result = AdminMessageHandleResult::HANDLED;
break;
@@ -580,7 +580,7 @@ AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule
void ExternalNotificationModule::handleGetRingtone(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response)
{
LOG_INFO("*** handleGetRingtone\n");
LOG_INFO("*** handleGetRingtone");
if (req.decoded.want_response) {
response->which_payload_variant = meshtastic_AdminMessage_get_ringtone_response_tag;
strncpy(response->get_ringtone_response, rtttlConfig.ringtone, sizeof(response->get_ringtone_response));
@@ -594,7 +594,7 @@ void ExternalNotificationModule::handleSetRingtone(const char *from_msg)
if (*from_msg) {
changed |= strcmp(rtttlConfig.ringtone, from_msg);
strncpy(rtttlConfig.ringtone, from_msg, sizeof(rtttlConfig.ringtone));
LOG_INFO("*** from_msg.text:%s\n", from_msg);
LOG_INFO("*** from_msg.text:%s", from_msg);
}
if (changed) {