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

Can I do pstorage store whit S120 scan start?

static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
    uint32_t           err_code;
    const               ble_gap_evt_t   * p_gap_evt = &p_ble_evt->evt.gap_evt;
    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_ADV_REPORT:
        {
	      pstorage_handle_t 		flash_handle;	
	      pstorage_block_identifier_get(&flash_base_handle,pstorage_block_id, &flash_handle);
	      err_code = pstorage_store(&flash_handle, (uint8_t * )&tx_data, 32, 0);
	      pstorage_block_id++ ;
        }
Parents
  • Hi YeLun,

    I spent a lot of time on this and I just verified by a simple app that scan and uses pstorage. It works just fine as intended. It should not matter if you call from event interrupt handler as long as you are using APP_PRIORITY_LOW for it. I do not know why your code does not work, but I would recommend you to check for error returns for all function calls that might fail with error. You are not doing this at many places.

Reply
  • Hi YeLun,

    I spent a lot of time on this and I just verified by a simple app that scan and uses pstorage. It works just fine as intended. It should not matter if you call from event interrupt handler as long as you are using APP_PRIORITY_LOW for it. I do not know why your code does not work, but I would recommend you to check for error returns for all function calls that might fail with error. You are not doing this at many places.

Children
No Data
Related