mirror of
https://github.com/yoboujon/dumber.git
synced 2025-06-08 13:50:49 +02:00
creation des niveau de battery, a regler sur banc
This commit is contained in:
parent
c5250eb3f4
commit
64b8f9fe08
7 changed files with 125 additions and 80 deletions
|
@ -327,28 +327,16 @@
|
||||||
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1151842665.1610208999" name="Resource Custom Build Step Output Type"/>
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1151842665.1610208999" name="Resource Custom Build Step Output Type"/>
|
||||||
</tool>
|
</tool>
|
||||||
</fileInfo>
|
</fileInfo>
|
||||||
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Application/application.c" name="application.c" rcbsApplicability="disable" resourcePath="Application/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.983087978">
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.1184097105" name="application.c" rcbsApplicability="disable" resourcePath="Application/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.298003348">
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.983087978" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.298003348" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.606614377" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.235309210" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1996673393" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1492946438" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.389963892.995306756" name="Resource Custom Build Step">
|
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.693102693" name="Resource Custom Build Step">
|
||||||
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.115340338.624270908" name="Resource Custom Build Step Input Type">
|
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.676361119" name="Resource Custom Build Step Input Type">
|
||||||
<additionalInput kind="additionalinputdependency" paths=""/>
|
<additionalInput kind="additionalinputdependency" paths=""/>
|
||||||
</inputType>
|
</inputType>
|
||||||
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1700687045.61103792" name="Resource Custom Build Step Output Type"/>
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.789962441" name="Resource Custom Build Step Output Type"/>
|
||||||
</tool>
|
|
||||||
</fileInfo>
|
|
||||||
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.200947957" name="leds.c" rcbsApplicability="disable" resourcePath="Application/leds.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.155574165">
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.155574165" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.301013410" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1898228332" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
|
||||||
</tool>
|
|
||||||
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.2113983486" name="Resource Custom Build Step">
|
|
||||||
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1308025369" name="Resource Custom Build Step Input Type">
|
|
||||||
<additionalInput kind="additionalinputdependency" paths=""/>
|
|
||||||
</inputType>
|
|
||||||
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.555839812" name="Resource Custom Build Step Output Type"/>
|
|
||||||
</tool>
|
</tool>
|
||||||
</fileInfo>
|
</fileInfo>
|
||||||
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.53808517" name="batterie.c" rcbsApplicability="disable" resourcePath="Application/batterie.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1171631638">
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.53808517" name="batterie.c" rcbsApplicability="disable" resourcePath="Application/batterie.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1171631638">
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef enum {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
APPLICATION_State state;
|
APPLICATION_State state;
|
||||||
uint8_t cmd;
|
uint8_t cmd;
|
||||||
uint16_t batteryVoltage;
|
uint16_t batteryState;
|
||||||
char batteryUpdate;
|
char batteryUpdate;
|
||||||
char inCharge;
|
char inCharge;
|
||||||
int32_t distance;
|
int32_t distance;
|
||||||
|
@ -143,7 +143,7 @@ void APPLICATION_MainThread(void* params) {
|
||||||
cmdSendAnswer(ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
break;
|
break;
|
||||||
case CMD_GET_BATTERY:
|
case CMD_GET_BATTERY:
|
||||||
cmdSendBatteryLevel(systemInfos.batteryVoltage);
|
cmdSendBatteryLevel(systemInfos.batteryState);
|
||||||
break;
|
break;
|
||||||
case CMD_GET_VERSION:
|
case CMD_GET_VERSION:
|
||||||
cmdSendVersion();
|
cmdSendVersion();
|
||||||
|
@ -177,25 +177,28 @@ void APPLICATION_MainThread(void* params) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* TODO
|
case MSG_ID_BAT_ADC_ERR:
|
||||||
* Revoir la gestion de la batterie ici
|
/* depart en panic: error 2 */
|
||||||
*/
|
break;
|
||||||
// case MSG_ID_BAT_CHARGE_OFF:
|
case MSG_ID_BAT_CHARGE_ERR:
|
||||||
// case MSG_ID_BAT_CHARGE_COMPLETE:
|
/* depart en panic: error 3 */
|
||||||
// systemInfos.batteryVoltage = *((uint16_t*)msg.data);
|
break;
|
||||||
// systemInfos.batteryUpdate = 1;
|
case MSG_ID_BAT_CHARGE_COMPLETE:
|
||||||
//
|
case MSG_ID_BAT_CHARGE_LOW:
|
||||||
// if (msg.id == MSG_ID_BAT_CHARGE_COMPLETE)
|
case MSG_ID_BAT_CHARGE_MED:
|
||||||
// systemInfos.inCharge =1;
|
case MSG_ID_BAT_CHARGE_HIGH:
|
||||||
// else
|
systemInfos.batteryUpdate=1;
|
||||||
// systemInfos.inCharge =0;
|
systemInfos.inCharge=1;
|
||||||
// break;
|
systemInfos.batteryState = msg.id;
|
||||||
//
|
break;
|
||||||
// case MSG_ID_BAT_CHARGE_ON:
|
case MSG_ID_BAT_CRITICAL_LOW:
|
||||||
// systemInfos.inCharge =1;
|
case MSG_ID_BAT_LOW:
|
||||||
// break;
|
case MSG_ID_BAT_MED:
|
||||||
|
case MSG_ID_BAT_HIGH:
|
||||||
case MSG_ID_MOTEURS_STOP:
|
systemInfos.batteryUpdate=1;
|
||||||
|
systemInfos.batteryState = msg.id;
|
||||||
|
break;
|
||||||
|
case MSG_ID_MOTEURS_END_OF_MOUVMENT:
|
||||||
systemInfos.endOfMouvement= 1;
|
systemInfos.endOfMouvement= 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -218,18 +221,43 @@ void APPLICATION_StateMachine() {
|
||||||
APPLICATION_TransitionToNewState(stateInCharge);
|
APPLICATION_TransitionToNewState(stateInCharge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO
|
if (systemInfos.batteryUpdate) {
|
||||||
* Revoir la gestion de la batterie ici
|
ledState = leds_off;
|
||||||
*/
|
|
||||||
// if (systemInfos.batteryUpdate) {
|
if (systemInfos.batteryState==MSG_ID_BAT_CRITICAL_LOW) {
|
||||||
// ledState = APPLICATION_BatteryLevel(systemInfos.batteryVoltage, systemInfos.state);
|
ledState = leds_bat_critical_low;
|
||||||
//
|
APPLICATION_TransitionToNewState(stateLowBatDisable);
|
||||||
// if (ledState == leds_niveau_bat_0)
|
} else if (systemInfos.state == stateInCharge) {
|
||||||
// APPLICATION_TransitionToNewState(stateLowBatDisable);
|
switch (systemInfos.batteryState) {
|
||||||
// else if (systemInfos.state==stateStartup) {
|
case MSG_ID_BAT_CHARGE_COMPLETE:
|
||||||
// MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
ledState= leds_bat_charge_complete;
|
||||||
// }
|
break;
|
||||||
// }
|
case MSG_ID_BAT_CHARGE_HIGH:
|
||||||
|
ledState= leds_bat_charge_high;
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_MED:
|
||||||
|
ledState= leds_bat_charge_med;
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_LOW:
|
||||||
|
ledState= leds_bat_charge_low;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (systemInfos.state==stateStartup) {
|
||||||
|
switch (systemInfos.batteryState) {
|
||||||
|
case MSG_ID_BAT_HIGH:
|
||||||
|
ledState= leds_bat_high;
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_MED:
|
||||||
|
ledState= leds_bat_med;
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_LOW:
|
||||||
|
ledState= leds_bat_low;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LEDS_Set(ledState);
|
||||||
|
}
|
||||||
|
|
||||||
if (systemInfos.cmd != CMD_NONE) {
|
if (systemInfos.cmd != CMD_NONE) {
|
||||||
/* a newer command just arrived, process it
|
/* a newer command just arrived, process it
|
||||||
|
@ -317,7 +345,7 @@ void APPLICATION_StateMachine() {
|
||||||
|
|
||||||
void APPLICATION_TransitionToNewState(APPLICATION_State new_state) {
|
void APPLICATION_TransitionToNewState(APPLICATION_State new_state) {
|
||||||
LEDS_State ledState = leds_off;
|
LEDS_State ledState = leds_off;
|
||||||
uint32_t data;
|
int32_t data;
|
||||||
|
|
||||||
switch (new_state) {
|
switch (new_state) {
|
||||||
case stateStartup:
|
case stateStartup:
|
||||||
|
@ -325,20 +353,20 @@ void APPLICATION_TransitionToNewState(APPLICATION_State new_state) {
|
||||||
break;
|
break;
|
||||||
case stateIdle:
|
case stateIdle:
|
||||||
ledState = leds_idle;
|
ledState = leds_idle;
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
LEDS_Set(ledState);
|
||||||
|
|
||||||
MESSAGE_SendMailbox(MOTEURS_Mailbox, MSG_ID_MOTEURS_STOP, APPLICATION_Mailbox, (void*)NULL);
|
MESSAGE_SendMailbox(MOTEURS_Mailbox, MSG_ID_MOTEURS_STOP, APPLICATION_Mailbox, (void*)NULL);
|
||||||
systemTimeout.watchdogEnabled=0;
|
systemTimeout.watchdogEnabled=0;
|
||||||
break;
|
break;
|
||||||
case stateRun:
|
case stateRun:
|
||||||
ledState = leds_run;
|
ledState = leds_run;
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
LEDS_Set(ledState);
|
||||||
|
|
||||||
MESSAGE_SendMailbox(MOTEURS_Mailbox, MSG_ID_MOTEURS_STOP, APPLICATION_Mailbox, (void*)NULL);
|
MESSAGE_SendMailbox(MOTEURS_Mailbox, MSG_ID_MOTEURS_STOP, APPLICATION_Mailbox, (void*)NULL);
|
||||||
break;
|
break;
|
||||||
case stateInMouvement:
|
case stateInMouvement:
|
||||||
ledState = leds_run;
|
ledState = leds_run;
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
LEDS_Set(ledState);
|
||||||
|
|
||||||
if (systemInfos.cmd == CMD_MOVE) {
|
if (systemInfos.cmd == CMD_MOVE) {
|
||||||
data = systemInfos.distance;
|
data = systemInfos.distance;
|
||||||
|
@ -349,19 +377,20 @@ void APPLICATION_TransitionToNewState(APPLICATION_State new_state) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case stateInCharge:
|
case stateInCharge:
|
||||||
ledState = APPLICATION_BatteryLevel(systemInfos.batteryVoltage, systemInfos.inCharge);
|
/* les leds sont gerées dans APPLICATION_StateMachine */
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
MESSAGE_SendMailbox(MOTEURS_Mailbox, MSG_ID_MOTEURS_STOP, APPLICATION_Mailbox, (void*)NULL);
|
||||||
systemTimeout.watchdogEnabled=0;
|
systemTimeout.watchdogEnabled=0;
|
||||||
break;
|
break;
|
||||||
case stateWatchdogDisable:
|
case stateWatchdogDisable:
|
||||||
ledState = leds_erreur_1;
|
ledState = leds_erreur_1;
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
LEDS_Set(ledState);
|
||||||
|
|
||||||
systemTimeout.watchdogEnabled=0;
|
systemTimeout.watchdogEnabled=0;
|
||||||
break;
|
break;
|
||||||
case stateLowBatDisable:
|
case stateLowBatDisable:
|
||||||
ledState = leds_bat_critical_low;
|
ledState = leds_bat_critical_low;
|
||||||
LEDS_Set(ledState);
|
LEDS_Set(ledState);
|
||||||
//MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledState);
|
|
||||||
systemTimeout.watchdogEnabled=0;
|
systemTimeout.watchdogEnabled=0;
|
||||||
|
|
||||||
vTaskDelay(pdMS_TO_TICKS(4000)); // wait 4s
|
vTaskDelay(pdMS_TO_TICKS(4000)); // wait 4s
|
||||||
|
|
|
@ -117,20 +117,49 @@ int BATTERIE_LireTension(uint16_t *val) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t BATTERIE_NiveauBatteryNormal[5] = {
|
/*
|
||||||
0
|
* Il faut considerer ces valeurs comme les seuils de baculement dans une categorie
|
||||||
};
|
* ou une autre
|
||||||
|
*
|
||||||
|
* Seuil : critical low high
|
||||||
|
* Tension batterie: 2.9 critic 3.1 low 3.3 med 3.6 high 4.2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define BATTERIE_LEVEL_CRITICAL 200
|
||||||
|
#define BATTERIE_LEVEL_LOW 300
|
||||||
|
#define BATTERIE_LEVEL_HIGH 500
|
||||||
|
|
||||||
const uint8_t BATTERIE_NiveauBatteryCharge[5] = {
|
#define BATTERIE_LEVEL_CHARGE_LOW 400
|
||||||
0
|
#define BATTERIE_LEVEL_CHARGE_HIGH 700
|
||||||
};
|
|
||||||
|
|
||||||
uint16_t BATTERIE_BatteryLevel(uint8_t voltage, BATTERIE_StatusChargerTypedef chargerStatus) {
|
uint16_t BATTERIE_BatteryLevel(uint8_t voltage, BATTERIE_StatusChargerTypedef chargerStatus) {
|
||||||
uint16_t msgId=0;
|
uint16_t msgId=0;
|
||||||
|
|
||||||
/* TODO: A faire
|
switch (chargerStatus) {
|
||||||
* Pour l'instant, testons les niveaux de batterie
|
case CHARGEUR_CHARGE_COMPLETE:
|
||||||
*/
|
msgId = MSG_ID_BAT_CHARGE_COMPLETE;
|
||||||
|
break;
|
||||||
|
case CHARGEUR_IN_CHARGE:
|
||||||
|
if (voltage<=BATTERIE_LEVEL_CHARGE_LOW)
|
||||||
|
msgId = MSG_ID_BAT_CHARGE_LOW;
|
||||||
|
else if (voltage>=BATTERIE_LEVEL_CHARGE_HIGH)
|
||||||
|
msgId = MSG_ID_BAT_CHARGE_HIGH;
|
||||||
|
else
|
||||||
|
msgId = MSG_ID_BAT_CHARGE_MED;
|
||||||
|
break;
|
||||||
|
case CHARGEUR_NOT_PLUGGED:
|
||||||
|
if (voltage<=BATTERIE_LEVEL_CRITICAL)
|
||||||
|
msgId = MSG_ID_BAT_CRITICAL_LOW;
|
||||||
|
else if (voltage<=BATTERIE_LEVEL_LOW)
|
||||||
|
msgId = MSG_ID_BAT_LOW;
|
||||||
|
else if (voltage>=BATTERIE_LEVEL_HIGH)
|
||||||
|
msgId = MSG_ID_BAT_HIGH;
|
||||||
|
else
|
||||||
|
msgId = MSG_ID_BAT_MED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
msgId = MSG_ID_BAT_CHARGE_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
return msgId;
|
return msgId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,18 +247,17 @@ void cmdSendString(char *str) {
|
||||||
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSendBatteryLevel(char level) {
|
void cmdSendBatteryLevel(uint16_t batteryState) {
|
||||||
char* answer;
|
char* answer;
|
||||||
char localLevel=level;
|
|
||||||
|
|
||||||
if (localLevel<0) localLevel=0;
|
switch (batteryState) {
|
||||||
else if (localLevel>2) localLevel=2;
|
case MSG_ID_BAT_CHARGE_COMPLETE:
|
||||||
|
case MSG_ID_BAT_CHARGE_HIGH:
|
||||||
switch (localLevel) {
|
case MSG_ID_BAT_HIGH:
|
||||||
case 2:
|
|
||||||
answer = cmdAddChecksum("2\r");
|
answer = cmdAddChecksum("2\r");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MSG_ID_BAT_CHARGE_MED:
|
||||||
|
case MSG_ID_BAT_MED:
|
||||||
answer = cmdAddChecksum("1\r");
|
answer = cmdAddChecksum("1\r");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -81,7 +81,7 @@ typedef struct __attribute__((packed)) {
|
||||||
CMD_Generic* cmdDecode(char* cmd, uint8_t length);
|
CMD_Generic* cmdDecode(char* cmd, uint8_t length);
|
||||||
void cmdSendAnswer(uint8_t ans);
|
void cmdSendAnswer(uint8_t ans);
|
||||||
void cmdSendString(char* str);
|
void cmdSendString(char* str);
|
||||||
void cmdSendBatteryLevel(char level);
|
void cmdSendBatteryLevel(uint16_t batteryState);
|
||||||
void cmdSendVersion(void);
|
void cmdSendVersion(void);
|
||||||
void cmdSendBusyState(uint8_t state);
|
void cmdSendBusyState(uint8_t state);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ extern QueueHandle_t XBEE_Mailbox;
|
||||||
#define MSG_ID_MOTEURS_STOP 0x40
|
#define MSG_ID_MOTEURS_STOP 0x40
|
||||||
#define MSG_ID_MOTEURS_MOVE 0x41
|
#define MSG_ID_MOTEURS_MOVE 0x41
|
||||||
#define MSG_ID_MOTEURS_TURN 0x42
|
#define MSG_ID_MOTEURS_TURN 0x42
|
||||||
|
#define MSG_ID_MOTEURS_END_OF_MOUVMENT 0x43
|
||||||
|
|
||||||
#define MSG_ID_XBEE_CMD 0x50
|
#define MSG_ID_XBEE_CMD 0x50
|
||||||
#define MSG_ID_XBEE_ANS 0x51
|
#define MSG_ID_XBEE_ANS 0x51
|
||||||
|
|
|
@ -75,13 +75,12 @@ void TESTS_BasicTests(void* params) {
|
||||||
char str[100];
|
char str[100];
|
||||||
|
|
||||||
ledsState = leds_run;
|
ledsState = leds_run;
|
||||||
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledsState); // show program is running
|
LEDS_Set(ledsState); // show program is running
|
||||||
|
|
||||||
switch (TESTS_Nbr) {
|
switch (TESTS_Nbr) {
|
||||||
case LEDS_Tests: //Leds tests
|
case LEDS_Tests: //Leds tests
|
||||||
|
|
||||||
while (ledsState<=leds_state_unknown) {
|
while (ledsState<=leds_state_unknown) {
|
||||||
//MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledsState);
|
|
||||||
LEDS_Set(ledsState);
|
LEDS_Set(ledsState);
|
||||||
vTaskDelay(pdMS_TO_TICKS(TESTS_PERIODE)); // wait 10s
|
vTaskDelay(pdMS_TO_TICKS(TESTS_PERIODE)); // wait 10s
|
||||||
ledsState++;
|
ledsState++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue