GTimer disable

Hello,

Im using Gtimer like this below to call my tick function every 250 milliseconds

GTimer.begin(0, (1 * 1000 * 200), tick, true, 0);

However the tick function access some variables used by the main program, so i want to disable the GTimer while the main program is accessing those variables.

How can i disable the timer interrupts and re-enable it. like this

void setup()
{
GTimer.begin(0, (1 * 1000 * 200), tick, true, 0);
}

void tick()
{
a=5;
}

void loop()
{
disable_timer_interrupts(); <<<<----------------
a=3;
enable_timer_interrupts(); <<<<<----------------
}

how do i briefly disable and enable the timer tick interrupt from the GTimer?

Thanks

You can refer to GTimerClass Class – Realtek IoT/Wi-Fi MCU Solutions