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
configurarParametros.cpp
00001 #include "appCommands.h" 00002 00003 #define SUCESSO 0 00004 #define TAMANHO_INVALIDO 0xff 00005 #define ERRO_GRAVACAO 0xfe 00006 00007 void cmdConfigurarParametros(char * dados, unsigned char tamanhoDados){ 00008 00009 if(tamanhoDados != sizeof(APP_PARAMETERS)){ 00010 exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)TAMANHO_INVALIDO); 00011 return; 00012 } 00013 00014 // Totalizador de ciclos de corte/religa nao deve ser alterado 00015 unsigned int totalizador = APP_PARAMETERS.contadorCiclos; 00016 memcpy((char *)&APP_PARAMETERS, dados, sizeof(APP_PARAMETERS)); 00017 APP_PARAMETERS.contadorCiclos = totalizador; 00018 00019 if(!param.saveParameters()){ 00020 DEBUG(printf("[GGS] Error writing parameters\r\n")); 00021 exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, (char)ERRO_GRAVACAO); 00022 return; 00023 } 00024 exec.enviaResposta(RESP_CONFIGURAR_PARAMETROS, SUCESSO); 00025 softReset(); 00026 }
Generated on Thu Jul 14 2022 00:24:57 by
1.7.2
