ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_task_flash.c File Reference
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

rd_status_t rt_flash_init (void)
 Initialize flash storage. More...
 
rd_status_t rt_flash_store (const uint16_t file_id, const uint16_t record_id, const void *const message, const size_t message_length)
 Store data to flash. More...
 
rd_status_t rt_flash_load (const uint16_t page_id, const uint16_t record_id, void *const message, const size_t message_length)
 Load data from flash. More...
 
bool rt_flash_busy (void)
 Check if flash is running an operation. More...
 

Detailed Description

Author
Otso Jousimaa otso@.nosp@m.ojou.nosp@m.sima..nosp@m.net
Date
2019-11-18 provide compile time choice incase no flash is available This module has 2 sets of code: If flash is enabled: on_error: In the event of a fatal error, the error, source file and line number are stored in an error file in flash. Then calls the bootloader, failing that reset. task_flash_init: calls print_error_cause which retrieves error file from flash and logs it(requires nRF52 DK board). Then sets up on_error as the call back error handler. If no flash: on_error: In the event of a fatal error calls the bootloader, failing that reset. task_flash_init: sets up on_error as the call back error handler. These are in addition to flash utility functions of load, free, is busy and gc_run(which yields until not busy)

Definition in file ruuvi_task_flash.c.