mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
AP_HAL_ChibiOS: remove dependency on Semaphores in QSPIDevice in BL
This commit is contained in:
parent
1afbf666ad
commit
39bd229279
@ -16,7 +16,11 @@
|
|||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <AP_HAL/HAL.h>
|
#include <AP_HAL/HAL.h>
|
||||||
|
#if !defined(HAL_BOOTLOADER_BUILD)
|
||||||
#include "Semaphores.h"
|
#include "Semaphores.h"
|
||||||
|
#else
|
||||||
|
#include <AP_HAL_Empty/Semaphores.h>
|
||||||
|
#endif
|
||||||
#include "AP_HAL_ChibiOS.h"
|
#include "AP_HAL_ChibiOS.h"
|
||||||
|
|
||||||
#if HAL_USE_I2C == TRUE || HAL_USE_SPI == TRUE || HAL_USE_WSPI == TRUE
|
#if HAL_USE_I2C == TRUE || HAL_USE_SPI == TRUE || HAL_USE_WSPI == TRUE
|
||||||
@ -34,7 +38,11 @@ public:
|
|||||||
DeviceBus(uint8_t _thread_priority, bool axi_sram);
|
DeviceBus(uint8_t _thread_priority, bool axi_sram);
|
||||||
|
|
||||||
struct DeviceBus *next;
|
struct DeviceBus *next;
|
||||||
|
#if defined(HAL_BOOTLOADER_BUILD)
|
||||||
|
Empty::Semaphore semaphore;
|
||||||
|
#else
|
||||||
Semaphore semaphore;
|
Semaphore semaphore;
|
||||||
|
#endif
|
||||||
Shared_DMA *dma_handle;
|
Shared_DMA *dma_handle;
|
||||||
|
|
||||||
AP_HAL::Device::PeriodicHandle register_periodic_callback(uint32_t period_usec, AP_HAL::Device::PeriodicCb, AP_HAL::Device *hal_device);
|
AP_HAL::Device::PeriodicHandle register_periodic_callback(uint32_t period_usec, AP_HAL::Device::PeriodicCb, AP_HAL::Device *hal_device);
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <AP_InternalError/AP_InternalError.h>
|
#include <AP_InternalError/AP_InternalError.h>
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "Scheduler.h"
|
#include "Scheduler.h"
|
||||||
#include "Semaphores.h"
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "hwdef/common/stm32_util.h"
|
#include "hwdef/common/stm32_util.h"
|
||||||
|
|
||||||
|
@ -26,7 +26,10 @@
|
|||||||
|
|
||||||
#if HAL_USE_WSPI == TRUE && defined(HAL_QSPI_DEVICE_LIST)
|
#if HAL_USE_WSPI == TRUE && defined(HAL_QSPI_DEVICE_LIST)
|
||||||
|
|
||||||
|
#if !defined(HAL_BOOTLOADER_BUILD)
|
||||||
#include "Semaphores.h"
|
#include "Semaphores.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Scheduler.h"
|
#include "Scheduler.h"
|
||||||
#include "Device.h"
|
#include "Device.h"
|
||||||
|
|
||||||
@ -99,8 +102,12 @@ public:
|
|||||||
|
|
||||||
AP_HAL::Semaphore* get_semaphore() override
|
AP_HAL::Semaphore* get_semaphore() override
|
||||||
{
|
{
|
||||||
|
#if !defined(HAL_BOOTLOADER_BUILD)
|
||||||
// if asking for invalid bus number use bus 0 semaphore
|
// if asking for invalid bus number use bus 0 semaphore
|
||||||
return &bus.semaphore;
|
return &bus.semaphore;
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool acquire_bus(bool acquire);
|
bool acquire_bus(bool acquire);
|
||||||
|
@ -884,19 +884,19 @@ def write_mcu_config(f):
|
|||||||
#define HAL_NO_RCIN_THREAD
|
#define HAL_NO_RCIN_THREAD
|
||||||
#define HAL_NO_SHARED_DMA FALSE
|
#define HAL_NO_SHARED_DMA FALSE
|
||||||
#define HAL_NO_ROMFS_SUPPORT TRUE
|
#define HAL_NO_ROMFS_SUPPORT TRUE
|
||||||
''')
|
|
||||||
if not env_vars['EXTERNAL_PROG_FLASH_MB']:
|
|
||||||
f.write('''
|
|
||||||
#define CH_CFG_USE_TM FALSE
|
#define CH_CFG_USE_TM FALSE
|
||||||
#define CH_CFG_USE_REGISTRY FALSE
|
#define CH_CFG_USE_REGISTRY FALSE
|
||||||
#define CH_CFG_USE_WAITEXIT FALSE
|
#define CH_CFG_USE_WAITEXIT FALSE
|
||||||
#define CH_CFG_USE_MEMPOOLS FALSE
|
#define CH_CFG_USE_MEMPOOLS FALSE
|
||||||
#define CH_DBG_FILL_THREADS FALSE
|
#define CH_DBG_FILL_THREADS FALSE
|
||||||
#define CH_CFG_USE_SEMAPHORES FALSE
|
|
||||||
#define CH_CFG_USE_HEAP FALSE
|
|
||||||
#define CH_CFG_USE_MUTEXES FALSE
|
#define CH_CFG_USE_MUTEXES FALSE
|
||||||
#define CH_CFG_USE_EVENTS FALSE
|
#define CH_CFG_USE_EVENTS FALSE
|
||||||
#define CH_CFG_USE_EVENTS_TIMEOUT FALSE
|
#define CH_CFG_USE_EVENTS_TIMEOUT FALSE
|
||||||
|
''')
|
||||||
|
if not env_vars['EXTERNAL_PROG_FLASH_MB']:
|
||||||
|
f.write('''
|
||||||
|
#define CH_CFG_USE_HEAP FALSE
|
||||||
|
#define CH_CFG_USE_SEMAPHORES FALSE
|
||||||
#define CH_CFG_USE_MEMCORE FALSE
|
#define CH_CFG_USE_MEMCORE FALSE
|
||||||
''')
|
''')
|
||||||
if env_vars.get('ROMFS_UNCOMPRESSED', False):
|
if env_vars.get('ROMFS_UNCOMPRESSED', False):
|
||||||
|
Loading…
Reference in New Issue
Block a user