EZR

Dependencies:   CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04

Fork of smartRamalKW by Equipe Firmware V2COM

Files at this revision

API Documentation at this revision

Comitter:
tpadovani
Date:
Wed Jun 17 23:09:51 2015 +0000
Parent:
2:b808b1743de2
Child:
4:2d0c2643c641
Commit message:
Compilando com as funcionalidades modularizadas. Falta implementa??o da aplica??o.

Changed in this revision

GGSProtocol.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
--- a/GGSProtocol.lib	Wed Jun 17 22:44:40 2015 +0000
+++ b/GGSProtocol.lib	Wed Jun 17 23:09:51 2015 +0000
@@ -1,1 +1,1 @@
-GGSProtocol#2e6d12c7ecd3
+GGSProtocol#9ff68bcb6ca0
--- a/main.cpp	Wed Jun 17 22:44:40 2015 +0000
+++ b/main.cpp	Wed Jun 17 23:09:51 2015 +0000
@@ -2,25 +2,25 @@
 
 static Watchdog wd;
 static Ticker tickerWd;
-//static SerialNumber sn;
-//static Parameters param ((unsigned char *)&APP_PARAMETERS, sizeof(APP_PARAMETERS));
-//CommandExecutor exec(1800, 2);
+static SerialNumber sn;
+static Parameters param ((unsigned char *)&APP_PARAMETERS, sizeof(APP_PARAMETERS));
+CommandExecutor exec(1800, 2);
 
 int main()
 {
     iniciaWd();
     
     printf("##### %s #####\r\n", version);
-//    printSerialNumber();
+    printSerialNumber();
 
-//    param.loadParameters();
-//    ggsStream.baud(19200);
-//    exec.carregaEndereco(sn.get());
-//    exec.iniciaExecutorComandos();
+    param.loadParameters();
+    ggsStream.baud(19200);
+    exec.carregaEndereco(sn.get());
+    exec.iniciaExecutorComandos();
     
-//    while(1){
-//        exec.trataPacoteGGS();
-//    }
+    while(1){
+        exec.trataPacoteGGS();
+    }
     
 }
 
@@ -38,21 +38,25 @@
     wd.Service();
 }
 
-//void softReset(){
-//    printf("SoftReset\r\n");
-//    tickerWd.detach();
-//}
+void softReset(){
+    printf("SoftReset\r\n");
+    tickerWd.detach();
+}
+
+void enviaRespostaGGS(unsigned char * dados, int tamanho){
+    for(int i=0; i < tamanho; i++){
+        ggsStream.putc(dados[i]);
+    }
+}
 
-//void enviaRespostaGGS(unsigned char * dados, int tamanho){
-//    for(int i=0; i < tamanho; i++){
-//        ggsStream.putc(dados[i]);
-//    }
-//}
+void executaComando(){
+    
+}
 
-//void printSerialNumber(){
-//    printf("SN: ");
-//    for(int i=0; i < SERIAL_LENGTH; i++){
-//        printf("%02x", sn.get()[i]);
-//    }
-//    printf("\r\n");
-//}
+void printSerialNumber(){
+    printf("SN: ");
+    for(int i=0; i < SERIAL_LENGTH; i++){
+        printf("%c", sn.get()[i]);
+    }
+    printf("\r\n");
+}
--- a/main.h	Wed Jun 17 22:44:40 2015 +0000
+++ b/main.h	Wed Jun 17 23:09:51 2015 +0000
@@ -4,14 +4,14 @@
 #include "mbed.h"
 #include "settings.h"
 #include "version.h"
-//#include "serialNumber.h"
-//#include "parameters.h"
-//#include "appParameters.h"
+#include "serialNumber.h"
+#include "parameters.h"
+#include "appParameters.h"
 #include "FreescaleWatchdog.h"
-//#include "v2hardware.h"
-//#include "ggs.h"
+#include "v2hardware.h"
+#include "ggs.h"
 
-//ParametersBlock APP_PARAMETERS;
+ParametersBlock APP_PARAMETERS;
 
 
 
@@ -28,6 +28,7 @@
 void feedWd();
 void softReset();
 void enviaRespostaGGS(unsigned char * dados, int tamanho);
+void executaComando();
 void printSerialNumber();