|
@@ -10,6 +10,15 @@ static int event_w_idx = 0;
|
|
|
static bool _event_full = false;
|
|
static bool _event_full = false;
|
|
|
|
|
|
|
|
void push_event(event_id_t id, s32 data) {
|
|
void push_event(event_id_t id, s32 data) {
|
|
|
|
|
+ if (id == Aux_Current_Short) {//when multi aux short, only recode the old
|
|
|
|
|
+ for (int i = 0; i < MAX_EVENT_SIZE; i++) {
|
|
|
|
|
+ if (_event[i].id == Aux_Current_Short) {
|
|
|
|
|
+ if (shark_get_seconds() - _event[i].timestamp <= 1) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
event_record_t *pevent = &_event[event_w_idx];
|
|
event_record_t *pevent = &_event[event_w_idx];
|
|
|
event_w_idx = (event_w_idx + 1) % MAX_EVENT_SIZE;
|
|
event_w_idx = (event_w_idx + 1) % MAX_EVENT_SIZE;
|
|
|
if (event_w_idx == 0) {
|
|
if (event_w_idx == 0) {
|