Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF5 SDK ATOMIC FIFO SECOND EXAMPLE ISSUE

Hi ,

I can not understand or there is something wrong in this example here ;

He defined "point_fifo" but initialized "my_fifo" , How does this work ?

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Flib_atfifo.html

struct point
{
     int x, y;
}point_t;
NRF_ATFIFO_DEF(point_fifo, point_t, 16);
int main(void)
{
    NRF_ATFIFO_INIT(my_fifo);
    nrf_atfifo_context_t context;
    point_t * point;
    if(NULL != (point = nrf_atfifo_item_alloc(point_fifo, &context)))
    {

Parents
  • Hello,

    This looks like typo in the guide.

    You can look at the ble_app_uart example in the SDK:

    SDK\examples\ble_peripheral\ble_app_uart.

    NRF_ATFIFO_DEF() is used in nrf_fstorage_sd.c for fstorage (writing to flash). I don't think this is actually much used, but you can see what it looks like when you initialize it.

    I believe that the guide should say:

    struct point
    {
         int x, y;
    }point_t;
    NRF_ATFIFO_DEF(point_fifo, point_t, 16);
    int main(void)
    {
        NRF_ATFIFO_INIT(point_fifo);
        nrf_atfifo_context_t context;
        point_t * point;
        if(NULL != (point = nrf_atfifo_item_alloc(point_fifo, &context)))
        {

    I'll report this internally. Thank you for reporting to us!

    Best regards,

    Edvin

Reply
  • Hello,

    This looks like typo in the guide.

    You can look at the ble_app_uart example in the SDK:

    SDK\examples\ble_peripheral\ble_app_uart.

    NRF_ATFIFO_DEF() is used in nrf_fstorage_sd.c for fstorage (writing to flash). I don't think this is actually much used, but you can see what it looks like when you initialize it.

    I believe that the guide should say:

    struct point
    {
         int x, y;
    }point_t;
    NRF_ATFIFO_DEF(point_fifo, point_t, 16);
    int main(void)
    {
        NRF_ATFIFO_INIT(point_fifo);
        nrf_atfifo_context_t context;
        point_t * point;
        if(NULL != (point = nrf_atfifo_item_alloc(point_fifo, &context)))
        {

    I'll report this internally. Thank you for reporting to us!

    Best regards,

    Edvin

Children
No Data
Related