zephyr/drivers/flash/flash_priv.h
Andrzej Puzdrowski d095963e73 drivers: flash: Assert implementation of Flash Page Layout
Some drivers doesn't implement flash API page layout extension
which is causing the application crash once the API was calling.
This patch introduce system termination for this in those drivers
which doesn't implement extension. This will help to discover this
problem early.

It is not done by preprocessor check because it is possible to have
enabled a driver which support and a driver which doesn't support
this API simultaneously.

Now FLASH_PAGE_LAYOUT configuration option is accessible only in case
that at last one driver which implements mentioned API is enabled.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-12-12 14:23:50 -06:00

17 lines
276 B
C

/*
* Copyright (c) 2017 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __FLASH_PRIV_H__
#define __FLASH_PRIV_H__
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
static inline void flash_page_layout_not_implemented(void)
{
k_panic();
}
#endif
#endif