This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Definitions of the Hal events

Hi,

It might be a simple question but I can't find any reference for it. When reading the hal_driver.h I found the following definitions:

#define HAL_BUZZER_EVENT                    0x0080
#define PERIOD_RSSI_RESET_EVT         0x0040
#define HAL_LED_BLINK_EVENT              0x0020
#define HAL_KEY_EVENT                             0x0010

Why exactly are these events defined as the above hex code? As far as I understand, these constants are used mainly by OSAL but I found no information about them in OSAL/HAL Driver/ User's Guide documents. Some help would be really appreciated.

Thanks in advance.

Nathan.

  • Hello Nathan112,

    Welcome to the Forum!

    The reason they are numbered that way in hex is because there are only 15 events that can be created for a profile.  Hex gives you a very good visual representation.  Those 4 events would be Events 5 to 8.  It could have been in binary but would be a little length.  I think it is mostly for convention because you could define them as decimal from 1..15 if you so desire.

    As to why they are ordered in that way?  The lowest number usually means the highest priority.

    Thanks,

  • Hi greenja,

    Thank you so much on the reply. It all make sense now.