1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 21:35:27 +03:00

#7210 merged (thanks Fiam)

This commit is contained in:
Bertrand Songis 2020-01-03 12:32:14 +01:00
parent de07f0dde4
commit cf7e45d7cd
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
4 changed files with 17 additions and 18 deletions

View file

@ -1979,12 +1979,20 @@ void opentxInit()
WDG_ENABLE(WDG_DURATION); WDG_ENABLE(WDG_DURATION);
} }
#if defined(SEMIHOSTING)
extern "C" void initialise_monitor_handles();
#endif
#if defined(SIMU) #if defined(SIMU)
void simuMain() void simuMain()
#else #else
int main() int main()
#endif #endif
{ {
#if defined(SEMIHOSTING)
initialise_monitor_handles();
#endif
#if defined(STM32) #if defined(STM32)
TRACE("reusableBuffer: modelSel=%d, moduleSetup=%d, calib=%d, sdManager=%d, hardwareAndSettings=%d, spectrumAnalyser=%d, usb=%d", TRACE("reusableBuffer: modelSel=%d, moduleSetup=%d, calib=%d, sdManager=%d, hardwareAndSettings=%d, spectrumAnalyser=%d, usb=%d",
sizeof(reusableBuffer.modelsel), sizeof(reusableBuffer.modelsel),

View file

@ -481,7 +481,7 @@ extern uint8_t flightModeTransitionLast;
#if defined(SIMU) #if defined(SIMU)
inline int availableMemory() { return 1000; } inline int availableMemory() { return 1000; }
#elif !defined(SIMU) #else
extern unsigned char *heap; extern unsigned char *heap;
extern int _end; extern int _end;
extern int _heap_end; extern int _heap_end;

View file

@ -73,7 +73,7 @@ extern int _close(int file)
extern int _fstat(int file, struct stat * st) extern int _fstat(int file, struct stat * st)
{ {
st->st_mode = S_IFCHR ; st->st_mode = S_IFCHR;
return 0; return 0;
} }
@ -97,6 +97,12 @@ extern int _write(int file, char *ptr, int len)
return 0; return 0;
} }
extern int _getpid()
{
return -1;
}
#endif
extern void _exit(int status) extern void _exit(int status)
{ {
TRACE("_exit(%d)", status); TRACE("_exit(%d)", status);
@ -105,12 +111,5 @@ extern void _exit(int status)
extern void _kill(int pid, int sig) extern void _kill(int pid, int sig)
{ {
return ; return;
} }
extern int _getpid()
{
return -1 ;
}
#endif

View file

@ -41,10 +41,6 @@ void watchdogInit(unsigned int duration)
IWDG->KR = 0xCCCC; // start IWDG->KR = 0xCCCC; // start
} }
#if defined(SEMIHOSTING)
extern "C" void initialise_monitor_handles();
#endif
#if defined(PCBX10) && !defined(RADIO_T16) #if defined(PCBX10) && !defined(RADIO_T16)
void sportUpdateInit() void sportUpdateInit()
{ {
@ -70,10 +66,6 @@ void sportUpdatePowerOff()
void boardInit() void boardInit()
{ {
#if defined(SEMIHOSTING)
initialise_monitor_handles();
#endif
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph | RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
PCBREV_RCC_AHB1Periph | PCBREV_RCC_AHB1Periph |
LED_RCC_AHB1Periph | LED_RCC_AHB1Periph |