AP_HAL_ChibiOS: remove dependency on Semaphores in QSPIDevice in BL

This commit is contained in:
Siddharth Purohit 2021-07-01 11:59:08 +05:30 committed by Andrew Tridgell
parent 1afbf666ad
commit 39bd229279
4 changed files with 20 additions and 6 deletions

View File

@ -16,7 +16,11 @@
#include <inttypes.h>
#include <AP_HAL/HAL.h>
#if !defined(HAL_BOOTLOADER_BUILD)
#include "Semaphores.h"
#else
#include <AP_HAL_Empty/Semaphores.h>
#endif
#include "AP_HAL_ChibiOS.h"
#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);
struct DeviceBus *next;
#if defined(HAL_BOOTLOADER_BUILD)
Empty::Semaphore semaphore;
#else
Semaphore semaphore;
#endif
Shared_DMA *dma_handle;
AP_HAL::Device::PeriodicHandle register_periodic_callback(uint32_t period_usec, AP_HAL::Device::PeriodicCb, AP_HAL::Device *hal_device);

View File

@ -25,7 +25,6 @@
#include <AP_InternalError/AP_InternalError.h>
#include "Util.h"
#include "Scheduler.h"
#include "Semaphores.h"
#include <stdio.h>
#include "hwdef/common/stm32_util.h"

View File

@ -26,7 +26,10 @@
#if HAL_USE_WSPI == TRUE && defined(HAL_QSPI_DEVICE_LIST)
#if !defined(HAL_BOOTLOADER_BUILD)
#include "Semaphores.h"
#endif
#include "Scheduler.h"
#include "Device.h"
@ -99,8 +102,12 @@ public:
AP_HAL::Semaphore* get_semaphore() override
{
#if !defined(HAL_BOOTLOADER_BUILD)
// if asking for invalid bus number use bus 0 semaphore
return &bus.semaphore;
#else
return nullptr;
#endif
}
bool acquire_bus(bool acquire);

View File

@ -884,19 +884,19 @@ def write_mcu_config(f):
#define HAL_NO_RCIN_THREAD
#define HAL_NO_SHARED_DMA FALSE
#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_REGISTRY FALSE
#define CH_CFG_USE_WAITEXIT FALSE
#define CH_CFG_USE_MEMPOOLS 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_EVENTS 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
''')
if env_vars.get('ROMFS_UNCOMPRESSED', False):