removed GPS IRQ, since not really needed
This commit is contained in:
1 parent
cb7b600168
commit
57d0624fd0
7 files changed
+5
-35
No files matched your search
@@ -45,12 +45,6 @@ void irqHandler(void *pvParameters) {
|
||||
refreshTheMatrixDisplay();
|
||||
#endif
|
||||
|
||||
// gps refresh buffer?
|
||||
#if (HAS_GPS)
|
||||
if (InterruptStatus & GPS_IRQ)
|
||||
gps_storelocation(&gps_status);
|
||||
#endif
|
||||
|
||||
// are cyclic tasks due?
|
||||
if (InterruptStatus & CYCLIC_IRQ)
|
||||
doHousekeeping();
|
||||
@@ -108,17 +102,6 @@ void IRAM_ATTR ButtonIRQ() {
|
||||
}
|
||||
#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 unmask_user_IRQ() { xTaskNotify(irqHandlerTask, UNMASK_IRQ, eSetBits); }
|
||||
+1
-12
@@ -48,7 +48,6 @@ So don't do it if you do not own a digital oscilloscope.
|
||||
-------------------------------------------------------------------------------
|
||||
0 displayIRQ -> display refresh -> 40ms (DISPLAYREFRESH_MS)
|
||||
1 ppsIRQ -> pps clock irq -> 1sec
|
||||
2 gpsIRQ -> gps store data -> 300ms
|
||||
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
|
||||
DisplayIRQ -> esp32 timer 0 -> irqHandlerTask (Core 1)
|
||||
CLOCKIRQ -> esp32 timer 1 -> ClockTask (Core 1)
|
||||
GpsIRQ -> esp32 timer 2 -> irqHandlerTask (Core 1)
|
||||
ButtonIRQ -> external gpio -> irqHandlerTask (Core 1)
|
||||
|
||||
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,
|
||||
batt_voltage = 0; // globals for display
|
||||
|
||||
hw_timer_t *ppsIRQ = NULL, *displayIRQ = NULL, *matrixDisplayIRQ = NULL,
|
||||
*gpsIRQ = NULL;
|
||||
hw_timer_t *ppsIRQ = NULL, *displayIRQ = NULL, *matrixDisplayIRQ = NULL;
|
||||
|
||||
TaskHandle_t irqHandlerTask = NULL, ClockTask = NULL;
|
||||
SemaphoreHandle_t I2Caccess;
|
||||
@@ -419,14 +416,6 @@ void setup() {
|
||||
button_init(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
|
||||
sendcycler.attach(SENDCYCLE * 2, sendcycle);
|
||||
housekeeper.attach(HOMECYCLE, housekeeping);
|
||||
|
||||
@@ -253,6 +253,7 @@ void get_status(uint8_t val[]) {
|
||||
void get_gps(uint8_t val[]) {
|
||||
ESP_LOGI(TAG, "Remote command: get gps status");
|
||||
#if(HAS_GPS)
|
||||
gps_storelocation(&gps_status);
|
||||
payload.reset();
|
||||
payload.addGPS(gps_status);
|
||||
SendPayload(GPSPORT, prio_high);
|
||||
|
||||
@@ -87,6 +87,7 @@ void sendCounter() {
|
||||
case GPS_DATA:
|
||||
// send GPS position only if we have a fix
|
||||
if (gps.location.isValid()) {
|
||||
gps_storelocation(&gps_status);
|
||||
payload.reset();
|
||||
payload.addGPS(gps_status);
|
||||
SendPayload(GPSPORT, prio_high);
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ void IRAM_ATTR CLOCKIRQ(void) {
|
||||
|
||||
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)
|
||||
gps_storetime(&gps_status);
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user