ota added

This commit is contained in:
Dmitry Borisenko
2020-09-17 21:33:54 +03:00
parent d6f5506812
commit e23481eef2
13 changed files with 186 additions and 153 deletions

View File

@@ -3,12 +3,12 @@
* Main consts
*/
#define FIRMWARE_NAME "esp8266-iotm"
#define FIRMWARE_VERSION "240"
#define FIRMWARE_VERSION 240
#define NUM_BUTTONS 6
#define LED_PIN 2
#define FLASH_4MB true
#define MQTT_RECONNECT_INTERVAL 20000
#define TELEMETRY_UPDATE_INTERVAL_MIN 60
@@ -22,7 +22,6 @@
#define TAG_ONE_WIRE "oneWire"
#define TAG_I2C "i2c"
#define TAG_ONE_WIRE_PIN "oneWirePin"
/*
* Optional
@@ -42,7 +41,6 @@
#define ANALOG_ENABLED
#define DALLAS_ENABLED
#define DHT_ENABLED
@@ -97,15 +95,15 @@ enum TimerTask_t { WIFI_SCAN,
TEST };
enum notAsincActions {
do_ZERO,
do_UPGRADE,
do_GETLASTVERSION,
do_UDPDATAPARSE,
do_MQTTUDP,
do_BUSSCAN,
do_MQTTPARAMSCHANGED,
do_LAST,
};
do_ZERO,
do_UPGRADE,
do_GETLASTVERSION,
do_UDPDATAPARSE,
do_MQTTUDP,
do_BUSSCAN,
do_MQTTPARAMSCHANGED,
do_LAST,
};
enum ErrorType_t {
ET_NONE,
@@ -137,5 +135,3 @@ enum BusScanner_t {
BS_I2C,
BS_ONE_WIRE
};

View File

@@ -80,7 +80,7 @@ extern int8_t dallasEnterCounter;
extern String logging_value_names_list;
extern int enter_to_logging_counter;
extern int scenario_line_status[40];
extern String lastVersion;
extern int lastVersion;
//Запрос на скарнирование шины

View File

@@ -1,8 +0,0 @@
#pragma once
#include <Arduino.h>
const String getAvailableUrl(const char* mcu);
void getLastVersion();
void upgradeInit();
void upgrade_firmware();

10
include/UpgradeFirm.h Normal file
View File

@@ -0,0 +1,10 @@
#pragma once
#include <Arduino.h>
extern void upgradeInit();
extern void getLastVersion();
extern void upgrade_firmware(int type);
extern bool upgradeFS();
extern bool upgradeBuild();
extern void restartEsp();