Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
cmd/configurarParametros.cpp
- Committer:
- tpadovani
- Date:
- 2015-07-24
- Revision:
- 11:8c93e0de58cd
- Parent:
- 10:7a1d1abb5172
- Child:
- 20:da03c9e94ad3
File content as of revision 11:8c93e0de58cd:
#include "appCommands.h"
#define SUCESSO 0
#define TAMANHO_INVALIDO 0xff
#define ERRO_GRAVACAO 0xfe
void cmdConfigurarParametros(char * dados, unsigned char tamanhoDados){
if(tamanhoDados != sizeof(APP_PARAMETERS)){
exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)TAMANHO_INVALIDO);
return;
}
// Totalizador de ciclos de corte/religa nao deve ser alterado
unsigned int totalizador = APP_PARAMETERS.contadorCiclos;
memcpy((char *)&APP_PARAMETERS, dados, sizeof(APP_PARAMETERS));
APP_PARAMETERS.contadorCiclos = totalizador;
if(!param.saveParameters()){
printf("[GGS] Erro gravando parametros\r\n");
exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)ERRO_GRAVACAO);
return;
}
exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, SUCESSO);
softReset();
}
