mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 05:33:34 +08:00
Temp fix - Needs to move to micro hal
This commit is contained in:
committed by
Lorenz Meier
parent
dcc2d1c3d1
commit
ddb033aa12
@@ -51,8 +51,12 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
#ifdef CONFIG_ARCH_BOARD_SIM
|
||||||
#include <stm32_pwr.h>
|
#define stm32_pwr_enablebkp(onoff)
|
||||||
|
#else
|
||||||
|
# if defined(CONFIG_ARCH_CHIP_STM32) || defined(CONFIG_ARCH_CHIP_STM32F7)
|
||||||
|
# include <stm32_pwr.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <systemlib/systemlib.h>
|
#include <systemlib/systemlib.h>
|
||||||
@@ -64,12 +68,11 @@ void
|
|||||||
px4_systemreset(bool to_bootloader)
|
px4_systemreset(bool to_bootloader)
|
||||||
{
|
{
|
||||||
if (to_bootloader) {
|
if (to_bootloader) {
|
||||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
stm32_pwr_enablebkp(true);
|
||||||
stm32_pwr_enablebkp();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* XXX wow, this is evil - write a magic number into backup register zero */
|
/* XXX wow, this is evil - write a magic number into backup register zero */
|
||||||
*(uint32_t *)0x40002850 = 0xb007b007;
|
*(uint32_t *)0x40002850 = 0xb007b007;
|
||||||
|
stm32_pwr_enablebkp(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
up_systemreset();
|
up_systemreset();
|
||||||
|
|||||||
Reference in New Issue
Block a user