mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Added DMA mapping (readonly for now), and enabled timer management for all F4 boards.
Converting the universal target as well. Simplified timer management some. Added F722 support for good measuer. Fixed SITL, tests. Cleanup after rebase. Added support for all timer consumers and F7. Fixed 'USE_DMA_SPEC' for F3, some cleanups.
This commit is contained in:
parent
9f8ad1aa44
commit
f8103b8c86
37 changed files with 904 additions and 484 deletions
|
@ -665,7 +665,7 @@ static serialPort_t *openEscSerial(escSerialPortIndex_e portIndex, serialReceive
|
|||
escSerial_t *escSerial = &(escSerialPorts[portIndex]);
|
||||
|
||||
if (mode != PROTOCOL_KISSALL) {
|
||||
escSerial->rxTimerHardware = &(timerHardware[output]);
|
||||
escSerial->rxTimerHardware = &(TIMER_HARDWARE[output]);
|
||||
// N-Channels can't be used as RX.
|
||||
if (escSerial->rxTimerHardware->output & TIMER_OUTPUT_N_CHANNEL) {
|
||||
return NULL;
|
||||
|
@ -731,11 +731,11 @@ static serialPort_t *openEscSerial(escSerialPortIndex_e portIndex, serialReceive
|
|||
for (volatile uint8_t i = 0; i < MAX_SUPPORTED_MOTORS; i++) {
|
||||
if (pwmMotors[i].enabled) {
|
||||
if (pwmMotors[i].io != IO_NONE) {
|
||||
for (volatile uint8_t j = 0; j < USABLE_TIMER_CHANNEL_COUNT; j++) {
|
||||
if (pwmMotors[i].io == IOGetByTag(timerHardware[j].tag))
|
||||
for (volatile uint8_t j = 0; j < TIMER_CHANNEL_COUNT; j++) {
|
||||
if (pwmMotors[i].io == IOGetByTag(TIMER_HARDWARE[j].tag))
|
||||
{
|
||||
escSerialOutputPortConfig(&timerHardware[j]);
|
||||
if (timerHardware[j].output & TIMER_OUTPUT_INVERTED) {
|
||||
escSerialOutputPortConfig(&TIMER_HARDWARE[j]);
|
||||
if (TIMER_HARDWARE[j].output & TIMER_OUTPUT_INVERTED) {
|
||||
escOutputs[escSerial->outputCount].inverted = 1;
|
||||
}
|
||||
break;
|
||||
|
@ -958,8 +958,8 @@ void escEnablePassthrough(serialPort_t *escPassthroughPort, uint16_t output, uin
|
|||
}
|
||||
else {
|
||||
uint8_t first_output = 0;
|
||||
for (unsigned i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_MOTOR) {
|
||||
for (unsigned i = 0; i < TIMER_CHANNEL_COUNT; i++) {
|
||||
if (TIMER_HARDWARE[i].usageFlags & TIM_USE_MOTOR) {
|
||||
first_output = i;
|
||||
break;
|
||||
}
|
||||
|
@ -967,7 +967,7 @@ void escEnablePassthrough(serialPort_t *escPassthroughPort, uint16_t output, uin
|
|||
|
||||
//doesn't work with messy timertable
|
||||
motor_output = first_output + output;
|
||||
if (motor_output >= USABLE_TIMER_CHANNEL_COUNT) {
|
||||
if (motor_output >= TIMER_CHANNEL_COUNT) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue