EZR
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
cmd/configurarParametros.cpp@10:7a1d1abb5172, 2015-07-23 (annotated)
- Committer:
- tpadovani
- Date:
- Thu Jul 23 22:46:18 2015 +0000
- Revision:
- 10:7a1d1abb5172
- Parent:
- 5:1bc98277c257
- Child:
- 11:8c93e0de58cd
Mem?ria de massa de tens?o e comando para ler o rel?gio atual.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tpadovani | 5:1bc98277c257 | 1 | #include "appCommands.h" |
tpadovani | 5:1bc98277c257 | 2 | |
tpadovani | 5:1bc98277c257 | 3 | #define SUCESSO 0 |
tpadovani | 5:1bc98277c257 | 4 | #define TAMANHO_INVALIDO 0xff |
tpadovani | 5:1bc98277c257 | 5 | #define ERRO_GRAVACAO 0xfe |
tpadovani | 5:1bc98277c257 | 6 | |
tpadovani | 10:7a1d1abb5172 | 7 | void cmdConfigurarParametros(char * dados, unsigned char tamanhoDados){ |
tpadovani | 5:1bc98277c257 | 8 | |
tpadovani | 5:1bc98277c257 | 9 | if(tamanhoDados != sizeof(APP_PARAMETERS)){ |
tpadovani | 5:1bc98277c257 | 10 | exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)TAMANHO_INVALIDO); |
tpadovani | 5:1bc98277c257 | 11 | return; |
tpadovani | 5:1bc98277c257 | 12 | } |
tpadovani | 5:1bc98277c257 | 13 | |
tpadovani | 10:7a1d1abb5172 | 14 | memcpy((char *)&APP_PARAMETERS, dados, sizeof(APP_PARAMETERS)); |
tpadovani | 5:1bc98277c257 | 15 | |
tpadovani | 5:1bc98277c257 | 16 | if(!param.saveParameters()){ |
tpadovani | 5:1bc98277c257 | 17 | printf("[GGS] Erro gravando parametros\r\n"); |
tpadovani | 5:1bc98277c257 | 18 | exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)ERRO_GRAVACAO); |
tpadovani | 5:1bc98277c257 | 19 | return; |
tpadovani | 5:1bc98277c257 | 20 | } |
tpadovani | 5:1bc98277c257 | 21 | exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, SUCESSO); |
tpadovani | 5:1bc98277c257 | 22 | softReset(); |
tpadovani | 5:1bc98277c257 | 23 | } |