stm32: flash: extract wait_for_last_operation to top level

This then eliminates the misguided attempts at merging f2/4 and f3 flash
support.  Some headers remain.
This commit is contained in:
Karl Palsson
2018-07-23 09:47:26 +00:00
parent c272ea410e
commit eafc46ff24
10 changed files with 13 additions and 48 deletions

View File

@@ -1,40 +0,0 @@
/** @addtogroup flash_file
*
*/
/*
* This file is part of the libopencm3 project.
*
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#include <libopencm3/stm32/flash.h>
/*---------------------------------------------------------------------------*/
/** @brief Wait until Last Operation has Ended
This loops indefinitely until an operation (write or erase) has completed by
testing the busy flag.
*/
void flash_wait_for_last_operation(void)
{
while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY);
}
/**@}*/

View File

@@ -26,6 +26,11 @@
#include <libopencm3/stm32/flash.h>
void flash_wait_for_last_operation(void)
{
while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY);
}
/*---------------------------------------------------------------------------*/
/** @brief Set the Program Parallelism Size

View File

@@ -45,7 +45,7 @@ OBJS += crc_common_all.o dac_common_all.o dma_common_f24.o \
timer_common_f24.o usart_common_all.o usart_common_f124.o \
hash_common_f24.o \
crypto_common_f24.o exti_common_all.o rcc_common_all.o
OBJS += flash_common_all.o flash_common_f.o flash_common_f234.o flash_common_f24.o
OBJS += flash_common_all.o flash_common_f.o flash_common_f24.o
OBJS += flash_common_idcache.o
OBJS += rng_common_v1.o
OBJS += spi_common_all.o spi_common_v1.o spi_common_v1_frf.o

View File

@@ -45,7 +45,7 @@ OBJS += gpio_common_all.o gpio_common_f0234.o \
timer_common_all.o timer_common_f0234.o \
exti_common_all.o rcc_common_all.o
OBJS += adc_common_v2.o adc_common_v2_multi.o
OBJS += flash_common_all.o flash_common_f.o flash_common_f234.o
OBJS += flash_common_all.o flash_common_f.o
OBJS += usart_common_v2.o usart_common_all.o
OBJS += i2c_common_v2.o
OBJS += spi_common_all.o spi_common_v2.o

View File

@@ -50,7 +50,7 @@ OBJS += crc_common_all.o dac_common_all.o dma_common_f24.o \
usart_common_f124.o \
hash_common_f24.o crypto_common_f24.o exti_common_all.o \
rcc_common_all.o
OBJS += flash_common_all.o flash_common_f.o flash_common_f234.o flash_common_f24.o
OBJS += flash_common_all.o flash_common_f.o flash_common_f24.o
OBJS += flash_common_idcache.o
OBJS += rng_common_v1.o
OBJS += spi_common_all.o spi_common_v1.o spi_common_v1_frf.o