teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Committer:
brunofgc
Date:
Fri Jun 08 22:14:21 2018 +0000
Revision:
38:07d3907b74e5
Parent:
37:0e95c85f0160
teste de publish para compilar no mbed-cli

Who changed what in which revision?

UserRevisionLine numberNew contents of line
brunofgc 0:1c0a769988ee 1 #ifndef _main_h_
brunofgc 0:1c0a769988ee 2 #define _main_h_
brunofgc 0:1c0a769988ee 3 #include "mbed.h"
brunofgc 0:1c0a769988ee 4 #include "modem.h"
brunofgc 0:1c0a769988ee 5 #include "devices.h"
brunofgc 0:1c0a769988ee 6 #include "CircularBuffer.h"
brunofgc 0:1c0a769988ee 7 #include "mediaMovel.h"
brunofgc 0:1c0a769988ee 8 #include "math.h"
brunofgc 0:1c0a769988ee 9 #include "IOs.h"
brunofgc 0:1c0a769988ee 10 #include "IRPack.h"
brunofgc 21:b9315cdd9275 11 #include "DS18B20_SensorTemperatura.h"
brunofgc 0:1c0a769988ee 12 #include "HighSpeedAnalogIn.h"
brunofgc 13:b9183b4bc049 13 #include "bootloader.h"
brunofgc 3:9598af355293 14 #define xereta_modem
brunofgc 18:1eefda1f7736 15 #define maxTentativasEnvioDados 5
brunofgc 0:1c0a769988ee 16
brunofgc 21:b9315cdd9275 17
brunofgc 21:b9315cdd9275 18
brunofgc 2:55b7b466e742 19 //#define serverAddress "186.202.127.244"
brunofgc 29:823a9da3696b 20 #define serverAddress "www.drome.com.br"
brunofgc 2:55b7b466e742 21
brunofgc 0:1c0a769988ee 22 //Inicializações de máquina;
brunofgc 0:1c0a769988ee 23 /*
brunofgc 0:1c0a769988ee 24 typedef struct _typeConfig{
brunofgc 0:1c0a769988ee 25 //Guarda todos os parametros de configuração do aparelho.
brunofgc 0:1c0a769988ee 26 //Sequencia Claro, Vivo, Tim, Oi
brunofgc 0:1c0a769988ee 27 char apnList[4][30]; //Endereço de APN para cada operadora. No caso Claro, Vivo, Tim, Oi
brunofgc 0:1c0a769988ee 28 char login[4][11]; //Login para cada operadora
brunofgc 0:1c0a769988ee 29 char senha[4][11]; //Senha para cada operadora
brunofgc 0:1c0a769988ee 30 char serverAddress[50]; //Dns para o servidor ex. norsulengenharia.com.br
brunofgc 0:1c0a769988ee 31 char numeroReportSMS[16];
brunofgc 0:1c0a769988ee 32 char serverPort[7]; //Porta para conexão entrante ex 44000
brunofgc 0:1c0a769988ee 33 uint16_t periodoDeEnvioDeDadosMinutos;
brunofgc 0:1c0a769988ee 34 char ultimoEstadoLigadoDesligado;
brunofgc 0:1c0a769988ee 35 uint16_t CRC;
brunofgc 0:1c0a769988ee 36 }typeConfig;
brunofgc 0:1c0a769988ee 37
brunofgc 0:1c0a769988ee 38 extern typeConfig flashConfig;
brunofgc 0:1c0a769988ee 39 */
brunofgc 0:1c0a769988ee 40
brunofgc 0:1c0a769988ee 41 //Definições de hardware
brunofgc 7:ae9c47f62946 42 extern DigitalOut ledLigado;
brunofgc 7:ae9c47f62946 43 extern DigitalOut ledEmComunicacao;
brunofgc 7:ae9c47f62946 44 extern DigitalOut ledConectadoInternet;
brunofgc 7:ae9c47f62946 45 extern DigitalOut ledUsoGeral;
brunofgc 0:1c0a769988ee 46 extern bool hardwareReset;
brunofgc 37:0e95c85f0160 47 extern bool debug;
brunofgc 37:0e95c85f0160 48 extern bool xeretaModem;
brunofgc 30:8a06a85d8807 49 extern char firmVersion[20];
brunofgc 33:a60abda630f7 50 extern char resetCauses[30];
brunofgc 0:1c0a769988ee 51
brunofgc 0:1c0a769988ee 52 extern DigitalOut ESP_CH_PD;
brunofgc 0:1c0a769988ee 53 extern DigitalOut ESP_RESET;
brunofgc 0:1c0a769988ee 54 extern DigitalOut ESP_ESPGPIO_2;
brunofgc 0:1c0a769988ee 55
brunofgc 0:1c0a769988ee 56 /*extern AnalogIn ai4;
brunofgc 0:1c0a769988ee 57 extern AnalogIn ai3;
brunofgc 0:1c0a769988ee 58 extern AnalogIn ai2;
brunofgc 0:1c0a769988ee 59 extern AnalogIn ai1;*/
brunofgc 0:1c0a769988ee 60
brunofgc 0:1c0a769988ee 61 extern MediaMovel FiltroAI4;
brunofgc 0:1c0a769988ee 62 extern MediaMovel FiltroAI3;
brunofgc 0:1c0a769988ee 63 extern MediaMovel FiltroAI2;
brunofgc 0:1c0a769988ee 64 extern MediaMovel FiltroAI1;
brunofgc 0:1c0a769988ee 65
brunofgc 0:1c0a769988ee 66 extern uint16_t aiFiltrada[4];
brunofgc 0:1c0a769988ee 67 extern bool entradasDigitais[9];
brunofgc 7:ae9c47f62946 68
brunofgc 0:1c0a769988ee 69
brunofgc 0:1c0a769988ee 70
brunofgc 0:1c0a769988ee 71 extern Serial pc; //Instancia de recurso Serial uart pc
brunofgc 0:1c0a769988ee 72 extern Serial modem; //Instancia de recurso Serial uart Modem
brunofgc 0:1c0a769988ee 73 extern Serial m200_Serial; //Instancia de recurso serial para medidor m200 modbus
brunofgc 0:1c0a769988ee 74
brunofgc 0:1c0a769988ee 75 extern CircularBuffer bufModem;
brunofgc 0:1c0a769988ee 76 extern CircularBuffer bufPC;
brunofgc 0:1c0a769988ee 77 extern CircularBuffer sdCardBuf;
brunofgc 7:ae9c47f62946 78 extern uint32_t act;
brunofgc 7:ae9c47f62946 79 extern bool boolExecAct;
brunofgc 7:ae9c47f62946 80 extern bool inicializaModemBool;
brunofgc 0:1c0a769988ee 81
brunofgc 0:1c0a769988ee 82 extern bool reportaMudancaAoServer;
brunofgc 0:1c0a769988ee 83 extern bool executaComandoServer;
brunofgc 0:1c0a769988ee 84 extern bool envioDadosAoServer;
brunofgc 7:ae9c47f62946 85
brunofgc 0:1c0a769988ee 86 extern uint8_t enviaDadosPorAlarme;
brunofgc 0:1c0a769988ee 87 extern DigitalOut max_de;
brunofgc 0:1c0a769988ee 88
brunofgc 0:1c0a769988ee 89 void loadStandardConfig(void);
brunofgc 0:1c0a769988ee 90 void RTC_POR_MINUTO(void);
brunofgc 0:1c0a769988ee 91 void inicializaMaquina(void);
brunofgc 30:8a06a85d8807 92
brunofgc 0:1c0a769988ee 93
brunofgc 7:ae9c47f62946 94
brunofgc 0:1c0a769988ee 95 extern arquivoSD *arquivoEnvioPointer;
brunofgc 0:1c0a769988ee 96
brunofgc 0:1c0a769988ee 97 //Threads
brunofgc 0:1c0a769988ee 98 //Timers
brunofgc 0:1c0a769988ee 99 extern osThreadId idThreadTimers;
brunofgc 0:1c0a769988ee 100 void threadTimers(void const *);
brunofgc 0:1c0a769988ee 101
brunofgc 0:1c0a769988ee 102 //Comunicacões
brunofgc 0:1c0a769988ee 103 extern osThreadId idThreadComunicacoes;
brunofgc 0:1c0a769988ee 104 void threadComunicacoes(void const *);
brunofgc 0:1c0a769988ee 105
brunofgc 0:1c0a769988ee 106 //ProcessaPacote
brunofgc 0:1c0a769988ee 107 extern osThreadId idThreadProcessaPacote;
brunofgc 0:1c0a769988ee 108 void threadProcessaPacote(void const *);
brunofgc 0:1c0a769988ee 109 //Threads
brunofgc 0:1c0a769988ee 110
brunofgc 30:8a06a85d8807 111 //Devices
brunofgc 0:1c0a769988ee 112 extern uint8_t devices;
brunofgc 30:8a06a85d8807 113 extern uint16_t alarmes;
brunofgc 30:8a06a85d8807 114 extern uint16_t leituras;
brunofgc 30:8a06a85d8807 115 extern uint16_t qtdSchedules;
brunofgc 30:8a06a85d8807 116 extern uint16_t qtdScheduleExceptions;
brunofgc 0:1c0a769988ee 117 void loadDevices();
brunofgc 0:1c0a769988ee 118 //Devices
brunofgc 0:1c0a769988ee 119
brunofgc 0:1c0a769988ee 120 #endif