Clearing a register from the main program

Thomas1
Posts: 11
Joined: Wed Jan 23, 2019 7:40 pm

Clearing a register from the main program

Postby Thomas1 » Wed May 22, 2019 11:03 pm

I need to stop an ULP program from running from the main program. According to the documentation:

"To disable the timer (effectively preventing the ULP program from running again), clear the RTC_CNTL_ULP_CP_SLP_TIMER_EN bit in the RTC_CNTL_STATE0_REG register. This can be done both from ULP code and from the main program."

I know how to do it in the ULP program itself

Code: Select all

WRITE_RTC_FIELD(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN, 0)
However, as I said I need to disable it from the main sketch. How do I do it?

Thanks.

Thomas1
Posts: 11
Joined: Wed Jan 23, 2019 7:40 pm

Re: Clearing a register from the main program

Postby Thomas1 » Thu May 23, 2019 12:06 pm

Well, I figured it out myself. You can just use the macro

Code: Select all

REG_CLR_BIT(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN);

Who is online

Users browsing this forum: No registered users and 82 guests