1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

timerHardware removal - all targets use fullTimerHardware now. (#12349)

* Removing last items associated with old timerHardware

* target.c rename, to identify purpose (should probably move to drivers/sitl or similar)

* Removing timerHardware dependency from timerup.c
This commit is contained in:
J Blackman 2023-02-15 02:47:44 +11:00 committed by GitHub
parent 69c779c0f7
commit 2dbbd1882c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 8 additions and 247 deletions

View file

@ -133,11 +133,6 @@ typedef enum {
#define MHZ_TO_HZ(x) ((x) * 1000000)
#if USABLE_TIMER_CHANNEL_COUNT > 0
extern const timerHardware_t timerHardware[];
#endif
#if defined(USE_TIMER_MGMT)
#if defined(STM32F4)

View file

@ -160,20 +160,8 @@ const timerHardware_t *timerAllocate(ioTag_t ioTag, resourceOwner_e owner, uint8
ioTag_t timerioTagGetByUsage(timerUsageFlag_e usageFlag, uint8_t index)
{
#if USABLE_TIMER_CHANNEL_COUNT > 0
uint8_t currentIndex = 0;
for (unsigned i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
if ((timerHardware[i].usageFlags & usageFlag) == usageFlag) {
if (currentIndex == index) {
return timerHardware[i].tag;
}
currentIndex++;
}
}
#else
UNUSED(usageFlag);
UNUSED(index);
#endif
return IO_TAG_NONE;
}
#endif

View file

@ -22,7 +22,7 @@
#include "platform.h"
#if defined(USE_TIMER_MGMT) && (defined(STM32H7) || defined(STM32G4))
#if defined(USE_TIMER_MGMT) && defined(USE_TIMER_UP_CONFIG)
#include "drivers/dma_reqmap.h"
#include "drivers/timer.h"
@ -36,14 +36,5 @@ void pgResetFn_timerUpConfig(timerUpConfig_t *config)
for (unsigned timno = 0; timno < HARDWARE_TIMER_DEFINITION_COUNT; timno++) {
config[timno].dmaopt = DMA_OPT_UNUSED;
}
#if USABLE_TIMER_CHANNEL_COUNT > 0
// Scan target timerHardware and extract dma option for TIMUP
for (unsigned i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
const timerHardware_t *timhw = &timerHardware[i];
uint8_t timnum = timerGetTIMNumber(timhw->tim) - 1;
config[timnum].dmaopt = dmaGetUpOptionByTimer(timhw);
}
#endif
}
#endif

View file

@ -27,11 +27,12 @@
#include "drivers/io.h"
#include "drivers/timer.h" // For HARDWARE_TIMER_DEFINITION_COUNT
#ifdef USE_TIMER_MGMT
#if defined(USE_TIMER_MGMT) && defined(USE_TIMER_UP_CONFIG)
typedef struct timerUpConfig_s {
int8_t dmaopt;
} timerUpConfig_t;
PG_DECLARE_ARRAY(timerUpConfig_t, HARDWARE_TIMER_DEFINITION_COUNT, timerUpConfig);
#endif

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -40,7 +40,6 @@
#include "drivers/timer.h"
#include "drivers/timer_def.h"
const timerHardware_t timerHardware[1]; // unused
#include "drivers/accgyro/accgyro_fake.h"
#include "flight/imu.h"

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -75,3 +75,4 @@
#define USE_CUSTOM_DEFAULTS
#define USE_EXTI
#define USE_TIMER_UP_CONFIG

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -99,3 +99,4 @@
#endif
#define USE_EXTI
#define USE_TIMER_UP_CONFIG

View file

@ -1,21 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>

View file

@ -111,3 +111,4 @@
#endif
#define USE_EXTI
#define USE_TIMER_UP_CONFIG

View file

@ -1,22 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
// Needed to suppress the pedantic warning about an empty file
#include <stddef.h>

View file

@ -85,3 +85,4 @@
#define USE_CUSTOM_DEFAULTS
#define USE_EXTI
#define USE_TIMER_UP_CONFIG

View file

@ -1,21 +0,0 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>

View file

@ -106,3 +106,4 @@
#endif
#define USE_EXTI
#define USE_TIMER_UP_CONFIG