Skip to content

Commit

Permalink
Fix extra logging areas
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Sep 6, 2024
1 parent 28d3ac0 commit cae1246
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ bool Config::SetEStopConfigGpioPin(gpio_num_t gpioPin) {
CONFIG_LOCK_WRITE(false);

if (!OpenShock::IsValidInputPin(gpioPin)) {
ESP_LOGE(TAG, "Invalid EStop GPIO Pin: %d", gpioPin);
OS_LOGE(TAG, "Invalid EStop GPIO Pin: %d", gpioPin);
return false;
}

Expand Down
14 changes: 7 additions & 7 deletions src/config/EStopConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void EStopConfig::ToDefault() {

bool EStopConfig::FromFlatbuffers(const Serialization::Configuration::EStopConfig* config) {
if (config == nullptr) {
ESP_LOGE(TAG, "config is null");
OS_LOGE(TAG, "config is null");
return false;
}

Expand All @@ -29,7 +29,7 @@ bool EStopConfig::FromFlatbuffers(const Serialization::Configuration::EStopConfi
uint8_t val = config->gpio_pin();

if (!OpenShock::IsValidInputPin(val)) {
ESP_LOGE(TAG, "Invalid EStop pin: %d", val);
OS_LOGE(TAG, "Invalid EStop pin: %d", val);
return false;
}

Expand All @@ -44,28 +44,28 @@ flatbuffers::Offset<OpenShock::Serialization::Configuration::EStopConfig> EStopC

bool EStopConfig::FromJSON(const cJSON* json) {
if (json == nullptr) {
ESP_LOGE(TAG, "json is null");
OS_LOGE(TAG, "json is null");
return false;
}

if (cJSON_IsObject(json) == 0) {
ESP_LOGE(TAG, "json is not an object");
OS_LOGE(TAG, "json is not an object");
return false;
}

if (!Internal::Utils::FromJsonBool(enabled, json, "enabled", false)) {
ESP_LOGE(TAG, "Failed to parse enabled");
OS_LOGE(TAG, "Failed to parse enabled");
return false;
}

uint8_t val;
if (!Internal::Utils::FromJsonU8(val, json, "gpioPin", OPENSHOCK_ESTOP_PIN)) {
ESP_LOGE(TAG, "Failed to parse gpioPin");
OS_LOGE(TAG, "Failed to parse gpioPin");
return false;
}

if (!OpenShock::IsValidInputPin(val)) {
ESP_LOGE(TAG, "Invalid EStop pin: %d", val);
OS_LOGE(TAG, "Invalid EStop pin: %d", val);
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/config/RootConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bool RootConfig::FromFlatbuffers(const Serialization::Configuration::HubConfig*
}

if (!estop.FromFlatbuffers(config->estop())) {
ESP_LOGE(TAG, "Unable to load estop config");
OS_LOGE(TAG, "Unable to load estop config");
return false;
}

Expand Down Expand Up @@ -89,7 +89,7 @@ bool RootConfig::FromJSON(const cJSON* json) {
}

if (!estop.FromJSON(cJSON_GetObjectItemCaseSensitive(json, "estop"))) {
ESP_LOGE(TAG, "Unable to load estop config");
OS_LOGE(TAG, "Unable to load estop config");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/event_handlers/websocket/local/SetEStopPinCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace OpenShock::MessageHandlers::Local;
void _Private::HandleSetEstopPinCommand(uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) {
auto msg = root->payload_as_SetEstopPinCommand();
if (msg == nullptr) {
ESP_LOGE(TAG, "Payload cannot be parsed as SetEstopPinCommand");
OS_LOGE(TAG, "Payload cannot be parsed as SetEstopPinCommand");
return;
}

Expand Down

0 comments on commit cae1246

Please sign in to comment.