mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Fix missing ADC4 dma mapping for F3.
Fix incorrect count of dma options for F3. Value was hardcoded to 3, but the F3 has 4 ADCs. Fix dmaPeripheralMapping for F3. The dmaPeripheralMapping table was using index numbers and not device numbers. This meant all the dma mappings were out by one, eg. ``` ``` ADC 1 is on DMA1, channel 1, but the output from dma ADC 2 list shows the possibilities for ADC 1, not ADC 2 and shows no possibilities for dma ADC 1 list Ensure there are defaults for ADC4 on F3. Always use 4 ADC instances for the ADC PG. * PG should not be target dependant. * Add a static assert which will fail if anything is changed. Fix dmaopt in ADC PG, it should be a int8_t, not uint8_t Fix occurrences of -1 that should be `DMA_OPT_UNUSED`. Fixing this meant that dma_reqmap.h needed to be included in a few places. When this was done there were errors because dma_reqmap.h was included more than once and it's `#pragma once` was commented out. Including dma_reqmap.h from every PG that uses `dmaopt` also caused other compilation issues, fixed by this commit.
This commit is contained in:
parent
692bf9c56e
commit
5fbb0674c5
11 changed files with 79 additions and 53 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "pg/pg.h"
|
||||
#include "pg/pg_ids.h"
|
||||
|
||||
#include "drivers/dma_reqmap.h"
|
||||
#include "drivers/io.h"
|
||||
#include "drivers/timer.h" // For HARDWARE_TIMER_DEFINITION_COUNT
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue