Skip to content

Commit

Permalink
Add EL for NaN check
Browse files Browse the repository at this point in the history
  • Loading branch information
200km committed May 29, 2024
1 parent d76513e commit 8c7c308
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/src_user/Library/SignalProcess/z_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <math.h>
#include <src_user/Library/math_constants.h>

#include <src_core/System/EventManager/event_logger.h>

//!< bilinear transformation
static C2A_MATH_ERROR Z_FILTER_bilinear_trans_(ZFilter* filter,
Expand Down Expand Up @@ -161,7 +161,8 @@ double Z_FILTER_calc_output_double(ZFilter* filter, const double input)
C2A_MATH_ERROR ret = C2A_MATH_check_nan_inf_double(input);
if (ret != C2A_MATH_ERROR_OK)
{
// TODO: Add Event Logger
// TODO: IDは現状テキトウな値なので、修正する(今はアプリIDと被らない大きな値にしている。)
EL_record_event(EL_GROUP_CALCULATION_ERROR, 201, EL_ERROR_LEVEL_LOW, (uint32_t)ret);
return filter->output_previous[0];
}

Expand Down
4 changes: 3 additions & 1 deletion src/src_user/Library/pid_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <math.h>

#include <src_core/System/TimeManager/time_manager.h>
#include <src_core/System/EventManager/event_logger.h>

#include "math_constants.h"

Expand Down Expand Up @@ -83,7 +84,8 @@ void PID_CONTROL_calc_output(PidControl* pid_control, const float error)
pid_control->control_output = 0.0f;
PID_CONTROL_reset_integral_error(pid_control);
pid_control->pre_error = 0.0f;
// TODO: Add Event Logger
// TODO: IDは現状テキトウな値なので、修正する(今はアプリIDと被らない大きな値にしている。)
EL_record_event(EL_GROUP_CALCULATION_ERROR, 200, EL_ERROR_LEVEL_LOW, (uint32_t)ret);
}

return;
Expand Down

0 comments on commit 8c7c308

Please sign in to comment.