How do we step out of a "lock zone"?

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
ceremcem
Posts: 53
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 5 times
Been thanked: 3 times

How do we step out of a "lock zone"?

Postby ceremcem » Tue Jun 25, 2019 1:31 pm

I'm trying to implement a debounce logic with the following procedure:

  1. Define an input callback (button_callback) and register it when the application starts.
  2. When an interrupt is received, disable the pad event on that pad inside this interrupt handler (button_callback)
  3. Wait for a debounce time (100ms, for example)
  4. Enable the pad event
  5. Return from button_callback function.

However, this logic isn't working because documentation says:

Code: Select all

palDisablePadEvent

Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.


How can we step out of the lock zone so that we could implement this logic?

User avatar
Giovanni
Site Admin
Posts: 12944
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 731 times
Been thanked: 609 times
Contact:

Re: How do we step out of a "lock zone"?

Postby Giovanni » Tue Jun 25, 2019 5:20 pm

Look at palDisableLineEventI().

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 2 guests