1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-07-01 15:25:24 +02:00
cdf2018-principal/arduino/debug.c

36 lines
972 B
C
Raw Normal View History

2018-02-14 18:27:04 +01:00
#include <string.h>
#include "debug.h"
#include "AC.h"
#include "position.h"
#include "movement.h"
void TaskDebug(void *pvParameters) {
(void) pvParameters;
for (;;) {
ulTaskNotifyTake(pdFALSE, portMAX_DELAY);
2018-02-14 18:27:04 +01:00
// Copie des valeurs à envoyer en debug
memcpy((void*) &debug.actuel, (const void*) &actuel, (unsigned long) sizeof(actuel));
memcpy((void*) &debug.destination, (const void*) &destination, (unsigned long) sizeof(destination));
2018-03-26 10:06:32 +02:00
memcpy((void*) &debug.deltaCoder, (const void*) &deltaCoder, (unsigned long) sizeof(deltaCoder));
2018-02-14 18:27:04 +01:00
debug.movement = movement;
2018-03-26 10:06:32 +02:00
debug.nbCalcPos = nbCalcPos;
nbCalcPos = 0;
2018-02-14 18:27:04 +01:00
// Envoi des valeurs
sendAC(A2CI_DBG, &debug, sizeof(debug));
}
}
void onA2CI_DBG() {
vTaskNotifyGiveFromISR(tDebug, NULL);
2018-02-14 18:27:04 +01:00
}
void configureDebug() {
registerRxHandlerAC(A2CI_DBG, onA2CI_DBG);
2018-02-14 18:27:04 +01:00
xTaskCreate(TaskDebug, "Debug", 128, NULL, 10, &tDebug);;
}