summaryrefslogtreecommitdiff
path: root/digital/beacon/src/trust.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon/src/trust.c')
-rw-r--r--digital/beacon/src/trust.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/digital/beacon/src/trust.c b/digital/beacon/src/trust.c
index 23823ef8..49bdb043 100644
--- a/digital/beacon/src/trust.c
+++ b/digital/beacon/src/trust.c
@@ -26,8 +26,10 @@
#include "position.h"
#include "trust.h"
#include "debug_simu.h"
+#include "debug_avr.h"
extern opponent_s opponent[MAX_OBSTACLE];
+static HAL_AppTimer_t trustTimer;
/* This function returns the trust level */
@@ -68,6 +70,16 @@ TTrustStatus trust_decrease(void)
opponent[i].trust--;
}
}
+
return TRUST_LEVEL_OK;
}
+
+void trust_decrease_task(void)
+{
+ trustTimer.interval = TRUST_DECREASE_TASK_PERIOD;
+ trustTimer.mode = TIMER_REPEAT_MODE;
+ trustTimer.callback = trust_decrease;
+ HAL_StartAppTimer(&trustTimer);
+}
+