This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multiple SAADC channels with Multiple BLE Characteristics

I have 2 Channels with SAADC taking samples. They are configured to respond to BLE characteristics that have read and notify properties, each channel has its own characteristic it responds to.

For BLE characteristic notifications I setup a double buffer and event callback and for BLE characteristic reads I call a blocking function. The problem is what if one Channel is running in notification mode with the double buffer and callback and the other Channel is called from BLE read request which is blocking.

How would this be handled? Should I just process them both in double buffering with callback and have each channel dump its result into a global variable that will be read by the BLE, in case a read is called?

The sample rate is 50ms.

SDK12.2 and GCC compiler

  • Hi,

    You cannot use the blocking functions when non-blocking sampling is setup. The blocking functions will setup buffer and trigger a single sample, just like non-blocking mode, it is just not visible to the user.

    Your second option is the way you need to go, if you do not want to disable the SAADC setup for notifications, to allow triggering a single sample for the read operation.

    Best regards,

    Jørgen

Related