summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
Diffstat (limited to 'digital')
-rw-r--r--digital/beacon/src/trust.c12
-rw-r--r--digital/beacon/src/trust.h1
2 files changed, 13 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);
+}
+
diff --git a/digital/beacon/src/trust.h b/digital/beacon/src/trust.h
index 8169660f..64a3104c 100644
--- a/digital/beacon/src/trust.h
+++ b/digital/beacon/src/trust.h
@@ -29,6 +29,7 @@
#define TRUST_MIN 0
#define TRUST_THRESHOLD 30
#define TRUST_MAX 100
+#define TRUST_DECREASE_TASK_PERIOD 500L
/* Status returns */
typedef enum