1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

OP-1477 - Add support for Flash

This commit is contained in:
Alessio Morale 2014-09-07 22:42:20 +02:00
parent 146c1764fd
commit 4890ef3ab0
4 changed files with 12 additions and 4 deletions

View File

@ -199,6 +199,10 @@ void PIOS_SPI_mag_flash_irq_handler(void)
PIOS_SPI_IRQ_Handler(pios_spi_mag_flash_id);
}
#ifdef PIOS_INCLUDE_FLASH
#include "pios_flash_jedec_priv.h"
#include "pios_flash.h"
#endif /* PIOS_INCLUDE_FLASH */
#if defined(PIOS_INCLUDE_HMC5X83)
#include "pios_hmc5x83.h"

View File

@ -56,6 +56,7 @@ SRC += $(OPSYSTEM)/pios_board.c
SRC += $(PIOSCOMMON)/pios_hmc5x83.c
SRC += $(PIOSCOMMON)/pios_ubx_dcc.c
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
## UAVObjects
SRC += $(OPUAVSYNTHDIR)/firmwareiapobj.c

View File

@ -112,7 +112,7 @@
/* #define PIOS_OVERO_SPI */
/* #define PIOS_INCLUDE_SDCARD */
/* #define LOG_FILENAME "startup.log" */
// #define PIOS_INCLUDE_FLASH
#define PIOS_INCLUDE_FLASH
// #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS
/* #define FLASH_FREERTOS */
/* #define PIOS_INCLUDE_FLASH_EEPROM */

View File

@ -44,10 +44,10 @@
#include "../board_hw_defs.c"
#define PIOS_COM_MAIN_RX_BUF_LEN 32
#define PIOS_COM_MAIN_TX_BUF_LEN 150
#define PIOS_COM_MAIN_TX_BUF_LEN 128
uint32_t pios_com_main_id;
uintptr_t flash_id;
/**
* PIOS_Board_Init()
* initializes all the core subsystems on this specific hardware
@ -76,6 +76,9 @@ void PIOS_Board_Init(void)
#ifdef PIOS_INCLUDE_HMC5X83
PIOS_SPI_SetClockSpeed(pios_spi_mag_flash_id, SPI_BaudRatePrescaler_16);
PIOS_HMC5x83_Init(&pios_mag_cfg, pios_spi_mag_flash_id, 0);
if (PIOS_Flash_Jedec_Init(&flash_id, pios_spi_mag_flash_id, 1)) {
PIOS_DEBUG_Assert(0);
}
#endif
#endif
@ -119,7 +122,7 @@ void PIOS_Board_Init(void)
#if defined(PIOS_INCLUDE_I2C)
{
if (PIOS_I2C_Init(&pios_i2c_gps_id, &pios_i2c_gps_cfg)) {
PIOS_Assert(0);
flash_id = -1;
}
}
#endif /* PIOS_INCLUDE_I2C */