mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
Added 'uint32_t PIOS_SYS_getCPUFlashSize(void)' into pios_sys.c/h files.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1616 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
c5fe985a45
commit
cc3860daaf
@ -42,6 +42,8 @@ void SysTick_Handler(void);
|
||||
|
||||
/* Local Macros */
|
||||
#define MEM8(addr) (*((volatile uint8_t *)(addr)))
|
||||
#define MEM16(addr) (*((volatile uint16_t *)(addr)))
|
||||
#define MEM32(addr) (*((volatile uint32_t *)(addr)))
|
||||
|
||||
/**
|
||||
* Initialises all system peripherals
|
||||
@ -127,6 +129,14 @@ int32_t PIOS_SYS_Reset(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CPU's flash size (in bytes)
|
||||
*/
|
||||
uint32_t PIOS_SYS_getCPUFlashSize(void)
|
||||
{
|
||||
return ((uint32_t)MEM16(0x1FFFF7E0) * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the serial number as a string
|
||||
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!
|
||||
@ -199,4 +209,4 @@ void assert_failed(uint8_t* file, uint32_t line)
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
@ -35,6 +35,7 @@
|
||||
/* Public Functions */
|
||||
extern void PIOS_SYS_Init(void);
|
||||
extern int32_t PIOS_SYS_Reset(void);
|
||||
extern uint32_t PIOS_SYS_getCPUFlashSize(void);
|
||||
extern int32_t PIOS_SYS_SerialNumberGet(char *str);
|
||||
|
||||
#endif /* PIOS_SYS_H */
|
||||
@ -42,4 +43,4 @@ extern int32_t PIOS_SYS_SerialNumberGet(char *str);
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user