Merge pull request #863 from cyberman54/development

Development
This commit is contained in:
Verkehrsrot authored and GitHub committed 2022-03-05 18:11:44 +01:00
commit 9a7dd6a9a5
8 files changed
+14 -29

No files matched your search

-3
View File
@@ -27,9 +27,6 @@ extern DRAM_ATTR bool TimePulseTick; // 1sec pps flag set by GPS or RTC
extern DRAM_ATTR unsigned long lastPPS;
extern hw_timer_t *ppsIRQ;
//void IRAM_ATTR CLOCKIRQ(void);
//void IRAM_ATTR GPSIRQ(void);
//void clock_loop(void *pvParameters);
void setTimeSyncIRQ(void);
void time_init(void);
bool timeIsValid(time_t const t);
-4
View File
@@ -10,10 +10,6 @@
// Hardware related definitions for Heltec V1 LoRa-32 Board
// see https://heltec-automation-docs.readthedocs.io/en/latest/esp32/wifi_lora_32/hardware_update_log.html#v1
//#define HAS_BME 1 // Enable BME sensors in general
//#define HAS_BME680 GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL
//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
#define CFG_sx1276_radio 1
-6
View File
@@ -10,12 +10,6 @@
// Hardware related definitions for Heltec V2 LoRa-32 Board
// see https://heltec-automation-docs.readthedocs.io/en/latest/esp32/wifi_lora_32/hardware_update_log.html#v2
//#define HAS_BME 1 // Enable BME sensors in general
//#define HAS_BME680 GPIO_NUM_4, GPIO_NUM_15 // SDA, SCL
//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND
//#define HAS_BMP180
//#define BMP180_ADDR 0x77
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
#define CFG_sx1276_radio 1
-6
View File
@@ -10,12 +10,6 @@
// Hardware related definitions for Heltec V2.1 LoRa-32 Board
// see https://heltec-automation-docs.readthedocs.io/en/latest/esp32/wifi_lora_32/hardware_update_log.html#v2-1
//#define HAS_BME 1 // Enable BME sensors in general
//#define HAS_BME680 GPIO_NUM_4, GPIO_NUM_15 // SDA, SCL
//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND
//#define HAS_BMP180
//#define BMP180_ADDR 0x77
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
#define CFG_sx1276_radio 1
+1 -2
View File
@@ -12,8 +12,7 @@ void i2c_init(void) {
Wire.begin();
}
// void i2c_deinit(void) { Wire.end(); }
void i2c_deinit(void) { Wire.~TwoWire(); }
void i2c_deinit(void) { Wire.end(); }
void i2c_scan(void) {
+3 -3
View File
@@ -471,15 +471,15 @@ void setup() {
button_init(HAS_BUTTON);
#endif // HAS_BUTTON
// cyclic function interrupts
cyclicTimer.attach(HOMECYCLE, setCyclicIRQ);
// only if we have a timesource we do timesync
#if ((HAS_LORA_TIME) || (HAS_GPS) || (HAS_RTC))
time_init();
strcat_P(features, " TIME");
#endif // timesync
// cyclic function interrupts
cyclicTimer.attach(HOMECYCLE, setCyclicIRQ);
// show compiled features
ESP_LOGI(TAG, "Features:%s", features);
+2
View File
@@ -65,6 +65,7 @@ time_t get_rtctime(uint16_t *msec) {
RtcDateTime tt = Rtc.GetDateTime();
t = tt.Epoch32Time(); // sec2000 -> epoch
}
/*
#ifdef RTC_INT
// adjust time to top of next second by waiting TimePulseTick to flip
bool lastTick = TimePulseTick;
@@ -72,6 +73,7 @@ time_t get_rtctime(uint16_t *msec) {
};
t++;
#endif
*/
return t;
} // get_rtctime()
+8 -5
View File
@@ -381,13 +381,16 @@ time_t mkgmtime(const struct tm *ptm) {
}
void time_init(void) {
#if (HAS_LORA_TIME)
timesync_init(); // create loraserver time sync task
#endif
ESP_LOGI(TAG, "Starting time pulse...");
timepulse_init(); // starts pps and cyclic time sync
#if (defined HAS_IF482 || defined HAS_DCF77)
ESP_LOGI(TAG, "Starting clock controller...");
clock_init();
#endif
#if (HAS_LORA_TIME)
timesync_init(); // create loraserver time sync task
#endif
ESP_LOGI(TAG, "Starting time pulse...");
timepulse_init(); // starts pps and cyclic time sync
}