/*
 * for some reason, espressif thought it nice to hardcode IRAM dependence in the HAL
 * but it's not necessary
 * 
 * I mean I understand it, but why write it the way you did
 * 
 * it's fucking retarded
 * just like the touch sensor being hardcoded to blocking only, it's braindead
 * 
 * my resolution: hardcode the handle for this interrupt and tell it to not need IRAM
 * since they don't really provide any other way to get it, it's static within the fn
 * it's either I do this or modify the HAL. doing it this way remains... "portable" ?
 * 
 * until it isn't. I tried it and it changed during code dev at some point
 * 
 * lol
 * 
 * so for now you'll have to edit esp32-hal-timer.c...
 */

#include "esp32-hal-timer.c"     // find this source file, and edit the line below
#include "esp32-hal-timer.h"
#include "esp_intr.h"


hw_timer_t *tmr_isr[6];						// was going to support several over different CPUs
volatile uint8_t tmr_isr_pending[6];		// but espressif code is braindead dumb sometimes


void timer_fucking_retarded_workaround()
{
    /*
    static const intr_handle_t hnd = (intr_handle_t)0x3FFD6A08;

    esp_intr_set_in_iram(hnd, 0);
    */

   /*
   change
266: esp_intr_alloc(intr_source, (int)(ESP_INTR_FLAG_IRAM|ESP_INTR_FLAG_LOWMED|ESP_INTR_FLAG_EDGE), __timerISR, NULL, &intr_handle);
    to
    esp_intr_alloc(intr_source, (int)(ESP_INTR_FLAG_LOWMED|ESP_INTR_FLAG_EDGE), __timerISR, NULL, &intr_handle);
    */
}