mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Code cleanup, remove old code and debug artifacts
This commit is contained in:
parent
06882b6a2c
commit
14bbc3ac07
4 changed files with 4 additions and 17 deletions
|
@ -52,6 +52,8 @@ void checkForBootLoaderRequest(void);
|
||||||
bool isMPUSoftReset(void);
|
bool isMPUSoftReset(void);
|
||||||
void cycleCounterInit(void);
|
void cycleCounterInit(void);
|
||||||
|
|
||||||
|
#define BOOTLOADER_REQUEST_COOKIE 0xDEADBEEF
|
||||||
|
|
||||||
void enableGPIOPowerUsageAndNoiseReductions(void);
|
void enableGPIOPowerUsageAndNoiseReductions(void);
|
||||||
// current crystal frequency - 8 or 12MHz
|
// current crystal frequency - 8 or 12MHz
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,6 @@ void systemReset(void)
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BOOTLOADER_REQUEST_COOKIE 0xDEADBEEF
|
|
||||||
|
|
||||||
void systemResetToBootloader(void)
|
void systemResetToBootloader(void)
|
||||||
{
|
{
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, BOOTLOADER_REQUEST_COOKIE);
|
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, BOOTLOADER_REQUEST_COOKIE);
|
||||||
|
|
|
@ -45,7 +45,7 @@ void systemReset(void)
|
||||||
|
|
||||||
void systemResetToBootloader(void)
|
void systemResetToBootloader(void)
|
||||||
{
|
{
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, 0xDEADBEEF);
|
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, BOOTLOADER_REQUEST_COOKIE);
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ void checkForBootLoaderRequest(void)
|
||||||
|
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, 0xCAFEFEED);
|
persistentObjectWrite(PERSISTENT_OBJECT_BOOTLOADER_REQUEST, 0xCAFEFEED);
|
||||||
|
|
||||||
if (bootloaderRequest != 0xDEADBEEF) {
|
if (bootloaderRequest != BOOTLOADER_REQUEST_COOKIE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,20 +260,7 @@ static const pllConfig_t overclockLevels[] = {
|
||||||
{ 480, RCC_PLLP_DIV2, 10 }, // 240 MHz
|
{ 480, RCC_PLLP_DIV2, 10 }, // 240 MHz
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
|
||||||
// 8 bytes of memory located at the very end of RAM, expected to be unoccupied
|
|
||||||
#define REQUEST_OVERCLOCK (*(__IO uint32_t *) (BKPSRAM_BASE + 8))
|
|
||||||
#define CURRENT_OVERCLOCK_LEVEL (*(__IO uint32_t *) (BKPSRAM_BASE + 12))
|
|
||||||
#define REQUEST_OVERCLOCK_MAGIC_COOKIE 0xBABEFACE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void SystemInitOC(void) {
|
void SystemInitOC(void) {
|
||||||
#if 0
|
|
||||||
__PWR_CLK_ENABLE();
|
|
||||||
__BKPSRAM_CLK_ENABLE();
|
|
||||||
HAL_PWR_EnableBkUpAccess();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint32_t currentOverclockLevel = persistentObjectRead(PERSISTENT_OBJECT_OVERCLOCK_LEVEL);
|
uint32_t currentOverclockLevel = persistentObjectRead(PERSISTENT_OBJECT_OVERCLOCK_LEVEL);
|
||||||
|
|
||||||
if (currentOverclockLevel >= ARRAYLEN(overclockLevels)) {
|
if (currentOverclockLevel >= ARRAYLEN(overclockLevels)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue