timekeeper once again reworked and shortened
This commit is contained in:
1 parent
5fb4c7bec2
commit
5c191a269f
9 files changed
+68
-78
No files matched your search
+8
-7
@@ -41,13 +41,13 @@
|
||||
#define SCREEN_MODE (0x80)
|
||||
|
||||
// I2C bus access control
|
||||
#define I2C_MUTEX_LOCK() \
|
||||
xSemaphoreTake(I2Caccess, (3 * DISPLAYREFRESH_MS / portTICK_PERIOD_MS)) == \
|
||||
pdTRUE
|
||||
#define I2C_MUTEX_LOCK()
|
||||
xSemaphoreTake(I2Caccess,
|
||||
(3 * DISPLAYREFRESH_MS / portTICK_PERIOD_MS)) == pdTRUE
|
||||
#define I2C_MUTEX_UNLOCK() xSemaphoreGive(I2Caccess)
|
||||
|
||||
// Struct holding devices's runtime configuration
|
||||
typedef struct {
|
||||
// Struct holding devices's runtime configuration
|
||||
typedef struct {
|
||||
uint8_t lorasf; // 7-12, lora spreadfactor
|
||||
uint8_t txpower; // 2-15, lora tx power
|
||||
uint8_t adrmode; // 0=disabled, 1=enabled
|
||||
@@ -107,8 +107,9 @@ extern configData_t cfg; // current device configuration
|
||||
extern char display_line6[], display_line7[]; // screen buffers
|
||||
extern uint8_t volatile channel; // wifi channel rotation counter
|
||||
extern uint16_t volatile macs_total, macs_wifi, macs_ble,
|
||||
batt_voltage; // display values
|
||||
extern bool volatile TimePulseTick; // one-pulse-per-second flags set by GPS or RTC
|
||||
batt_voltage; // display values
|
||||
extern bool volatile TimePulseTick; // one-pulse-per-second flags set by GPS or
|
||||
// RTC
|
||||
extern hw_timer_t *sendCycle, *displaytimer, *clockCycle;
|
||||
extern SemaphoreHandle_t I2Caccess, TimePulse;
|
||||
extern TaskHandle_t irqHandlerTask, ClockTask;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <TinyGPS++.h> // library for parsing NMEA data
|
||||
#include <RtcDateTime.h>
|
||||
#include "timekeeper.h"
|
||||
|
||||
#ifdef GPS_I2C // Needed for reading from I2C Bus
|
||||
#include <Wire.h>
|
||||
|
||||
+2
-3
@@ -2,15 +2,14 @@
|
||||
#define _IF482_H
|
||||
|
||||
#include "globals.h"
|
||||
#include "timekeeper.h"
|
||||
|
||||
#define IF482_FRAME_SIZE (17)
|
||||
#define IF482_PULSE_LENGTH (1000)
|
||||
|
||||
extern HardwareSerial IF482;
|
||||
extern HardwareSerial IF482;
|
||||
|
||||
void IF482_Pulse(time_t t);
|
||||
String IRAM_ATTR IF482_Frame(time_t tt);
|
||||
TickType_t tx_Ticks(unsigned long baud, uint32_t config, int8_t rxPin,
|
||||
int8_t txPins);
|
||||
|
||||
#endif
|
||||
@@ -20,12 +20,13 @@ void clock_init(void);
|
||||
void clock_loop(void *pvParameters);
|
||||
time_t time_sync(void);
|
||||
void timepulse_start(void);
|
||||
time_t syncTime(getExternalTime getTimeFunction, timesource_t const caller);
|
||||
uint8_t timepulse_init(void);
|
||||
uint8_t TimeIsValid(time_t const t);
|
||||
time_t TimeIsValid(time_t const t);
|
||||
time_t syncProvider_CB(void);
|
||||
time_t compiledUTC(void);
|
||||
time_t tmConvert(uint16_t YYYY, uint8_t MM, uint8_t DD, uint8_t hh, uint8_t mm,
|
||||
uint8_t ss);
|
||||
TickType_t tx_Ticks(uint32_t framesize, unsigned long baud, uint32_t config,
|
||||
int8_t rxPin, int8_t txPins);
|
||||
|
||||
#endif // _timekeeper_H
|
||||
Reference in new issue
Block a user