removed GPS IRQ, since not really needed
This commit is contained in:
parent
cb7b600168
commit
57d0624fd0
@ -112,7 +112,7 @@ extern uint16_t volatile macs_total, macs_wifi, macs_ble,
|
|||||||
batt_voltage; // display values
|
batt_voltage; // display values
|
||||||
extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
|
extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
|
||||||
extern timesource_t timeSource;
|
extern timesource_t timeSource;
|
||||||
extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ, *gpsIRQ;
|
extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ;
|
||||||
extern SemaphoreHandle_t I2Caccess;
|
extern SemaphoreHandle_t I2Caccess;
|
||||||
extern TaskHandle_t irqHandlerTask, ClockTask;
|
extern TaskHandle_t irqHandlerTask, ClockTask;
|
||||||
extern TimerHandle_t WifiChanTimer;
|
extern TimerHandle_t WifiChanTimer;
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#define TIMESYNC_IRQ 0x010
|
#define TIMESYNC_IRQ 0x010
|
||||||
#define MASK_IRQ 0x020
|
#define MASK_IRQ 0x020
|
||||||
#define UNMASK_IRQ 0x040
|
#define UNMASK_IRQ 0x040
|
||||||
#define GPS_IRQ 0x080
|
|
||||||
#define MATRIX_DISPLAY_IRQ 0x100
|
#define MATRIX_DISPLAY_IRQ 0x100
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@ -32,8 +31,5 @@ void IRAM_ATTR MatrixDisplayIRQ();
|
|||||||
void IRAM_ATTR ButtonIRQ();
|
void IRAM_ATTR ButtonIRQ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (HAS_GPS)
|
|
||||||
void IRAM_ATTR GpsIRQ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -45,12 +45,6 @@ void irqHandler(void *pvParameters) {
|
|||||||
refreshTheMatrixDisplay();
|
refreshTheMatrixDisplay();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// gps refresh buffer?
|
|
||||||
#if (HAS_GPS)
|
|
||||||
if (InterruptStatus & GPS_IRQ)
|
|
||||||
gps_storelocation(&gps_status);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// are cyclic tasks due?
|
// are cyclic tasks due?
|
||||||
if (InterruptStatus & CYCLIC_IRQ)
|
if (InterruptStatus & CYCLIC_IRQ)
|
||||||
doHousekeeping();
|
doHousekeeping();
|
||||||
@ -108,17 +102,6 @@ void IRAM_ATTR ButtonIRQ() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (HAS_GPS)
|
|
||||||
void IRAM_ATTR GpsIRQ() {
|
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
|
||||||
|
|
||||||
xTaskNotifyFromISR(irqHandlerTask, GPS_IRQ, eSetBits,
|
|
||||||
&xHigherPriorityTaskWoken);
|
|
||||||
if (xHigherPriorityTaskWoken)
|
|
||||||
portYIELD_FROM_ISR();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void mask_user_IRQ() { xTaskNotify(irqHandlerTask, MASK_IRQ, eSetBits); }
|
void mask_user_IRQ() { xTaskNotify(irqHandlerTask, MASK_IRQ, eSetBits); }
|
||||||
|
|
||||||
void unmask_user_IRQ() { xTaskNotify(irqHandlerTask, UNMASK_IRQ, eSetBits); }
|
void unmask_user_IRQ() { xTaskNotify(irqHandlerTask, UNMASK_IRQ, eSetBits); }
|
13
src/main.cpp
13
src/main.cpp
@ -48,7 +48,6 @@ So don't do it if you do not own a digital oscilloscope.
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
0 displayIRQ -> display refresh -> 40ms (DISPLAYREFRESH_MS)
|
0 displayIRQ -> display refresh -> 40ms (DISPLAYREFRESH_MS)
|
||||||
1 ppsIRQ -> pps clock irq -> 1sec
|
1 ppsIRQ -> pps clock irq -> 1sec
|
||||||
2 gpsIRQ -> gps store data -> 300ms
|
|
||||||
3 MatrixDisplayIRQ -> matrix mux cycle -> 0,5ms (MATRIX_DISPLAY_SCAN_US)
|
3 MatrixDisplayIRQ -> matrix mux cycle -> 0,5ms (MATRIX_DISPLAY_SCAN_US)
|
||||||
|
|
||||||
|
|
||||||
@ -58,7 +57,6 @@ So don't do it if you do not own a digital oscilloscope.
|
|||||||
fired by hardware
|
fired by hardware
|
||||||
DisplayIRQ -> esp32 timer 0 -> irqHandlerTask (Core 1)
|
DisplayIRQ -> esp32 timer 0 -> irqHandlerTask (Core 1)
|
||||||
CLOCKIRQ -> esp32 timer 1 -> ClockTask (Core 1)
|
CLOCKIRQ -> esp32 timer 1 -> ClockTask (Core 1)
|
||||||
GpsIRQ -> esp32 timer 2 -> irqHandlerTask (Core 1)
|
|
||||||
ButtonIRQ -> external gpio -> irqHandlerTask (Core 1)
|
ButtonIRQ -> external gpio -> irqHandlerTask (Core 1)
|
||||||
|
|
||||||
fired by software (Ticker.h)
|
fired by software (Ticker.h)
|
||||||
@ -82,8 +80,7 @@ uint8_t volatile channel = 0; // channel rotation counter
|
|||||||
uint16_t volatile macs_total = 0, macs_wifi = 0, macs_ble = 0,
|
uint16_t volatile macs_total = 0, macs_wifi = 0, macs_ble = 0,
|
||||||
batt_voltage = 0; // globals for display
|
batt_voltage = 0; // globals for display
|
||||||
|
|
||||||
hw_timer_t *ppsIRQ = NULL, *displayIRQ = NULL, *matrixDisplayIRQ = NULL,
|
hw_timer_t *ppsIRQ = NULL, *displayIRQ = NULL, *matrixDisplayIRQ = NULL;
|
||||||
*gpsIRQ = NULL;
|
|
||||||
|
|
||||||
TaskHandle_t irqHandlerTask = NULL, ClockTask = NULL;
|
TaskHandle_t irqHandlerTask = NULL, ClockTask = NULL;
|
||||||
SemaphoreHandle_t I2Caccess;
|
SemaphoreHandle_t I2Caccess;
|
||||||
@ -419,14 +416,6 @@ void setup() {
|
|||||||
button_init(HAS_BUTTON);
|
button_init(HAS_BUTTON);
|
||||||
#endif // HAS_BUTTON
|
#endif // HAS_BUTTON
|
||||||
|
|
||||||
// gps buffer read interrupt
|
|
||||||
#if (HAS_GPS)
|
|
||||||
gpsIRQ = timerBegin(2, 80, true);
|
|
||||||
timerAttachInterrupt(gpsIRQ, &GpsIRQ, true);
|
|
||||||
timerAlarmWrite(gpsIRQ, 300 * 1000, true);
|
|
||||||
timerAlarmEnable(gpsIRQ);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// cyclic function interrupts
|
// cyclic function interrupts
|
||||||
sendcycler.attach(SENDCYCLE * 2, sendcycle);
|
sendcycler.attach(SENDCYCLE * 2, sendcycle);
|
||||||
housekeeper.attach(HOMECYCLE, housekeeping);
|
housekeeper.attach(HOMECYCLE, housekeeping);
|
||||||
|
@ -253,6 +253,7 @@ void get_status(uint8_t val[]) {
|
|||||||
void get_gps(uint8_t val[]) {
|
void get_gps(uint8_t val[]) {
|
||||||
ESP_LOGI(TAG, "Remote command: get gps status");
|
ESP_LOGI(TAG, "Remote command: get gps status");
|
||||||
#if(HAS_GPS)
|
#if(HAS_GPS)
|
||||||
|
gps_storelocation(&gps_status);
|
||||||
payload.reset();
|
payload.reset();
|
||||||
payload.addGPS(gps_status);
|
payload.addGPS(gps_status);
|
||||||
SendPayload(GPSPORT, prio_high);
|
SendPayload(GPSPORT, prio_high);
|
||||||
|
@ -87,6 +87,7 @@ void sendCounter() {
|
|||||||
case GPS_DATA:
|
case GPS_DATA:
|
||||||
// send GPS position only if we have a fix
|
// send GPS position only if we have a fix
|
||||||
if (gps.location.isValid()) {
|
if (gps.location.isValid()) {
|
||||||
|
gps_storelocation(&gps_status);
|
||||||
payload.reset();
|
payload.reset();
|
||||||
payload.addGPS(gps_status);
|
payload.addGPS(gps_status);
|
||||||
SendPayload(GPSPORT, prio_high);
|
SendPayload(GPSPORT, prio_high);
|
||||||
|
@ -131,7 +131,7 @@ void IRAM_ATTR CLOCKIRQ(void) {
|
|||||||
|
|
||||||
SyncToPPS(); // advance systime, see microTime.h
|
SyncToPPS(); // advance systime, see microTime.h
|
||||||
|
|
||||||
// store recent gps time, and try to get gps time if time is not synced
|
// store recent gps time
|
||||||
#if (HAS_GPS)
|
#if (HAS_GPS)
|
||||||
gps_storetime(&gps_status);
|
gps_storetime(&gps_status);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user