wfdudley/T-watch-2020

Unable to compile RTC_INT undefined

Closed this issue · 1 comments

There are a lot of mentions of RTC_INT in the code, but it's not defined anywhere. Which gpio is it?

exit status 1
'RTC_INT' was not declared in this scope
  attachInterrupt(RTC_INT, [] {
      rtcIrq = 1;
      BaseType_t xHigherPriorityTaskWoken = pdFALSE;
      EventBits_t  bits = xEventGroupGetBitsFromISR(isr_group);
      if (bits & WATCH_FLAG_SLEEP_MODE)
      {
	  //! For quick wake up, use the group flag
	  xEventGroupSetBitsFromISR(isr_group, WATCH_FLAG_SLEEP_EXIT | WATCH_FLAG_AXP_IRQ, &xHigherPriorityTaskWoken);
      } else
      {
	  uint8_t data = Q_EVENT_AXP_INT;
	  xQueueSendFromISR(g_event_queue_handle, &data, &xHigherPriorityTaskWoken);
      }
      if (xHigherPriorityTaskWoken)
      {
	  portYIELD_FROM_ISR ();
      }
  }, FALLING);```

It's defined in libraries/TTGO_TWatch_Library-master/src/board/twatch2020_v1.h as pin 37.
You must always include "config.h". That pulls in LilyGoWatch.h. That pulls in the above file that defines RTC_INT.

A suggestion: if you develop on Linux or Mac, learn to use this command:

find ~/Arduino -type f -print0 | xargs -0 grep RTC_INT

So you can find where something is defined. I spent hours
with that command trying to figure out how to wake the watch
using the rtc alarm function.