mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-03-22 01:31:21 +03:00
add floating print to STM32F303
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
|
||||
#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
|
||||
This value must be a multiple of 0x200. */
|
||||
/*
|
||||
TRUE_INLINE void enable_FPU(){
|
||||
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); // set CP10 and CP11 Full Access
|
||||
}*/
|
||||
|
||||
//extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
//extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
|
||||
@@ -45,11 +49,6 @@
|
||||
*/
|
||||
TRUE_INLINE void sysreset(void) // not usable
|
||||
{
|
||||
/* FPU settings ------------------------------------------------------------*/
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
|
||||
#endif
|
||||
|
||||
/* Reset the RCC clock configuration to the default reset state ------------*/
|
||||
/* Set HSION bit */
|
||||
RCC->CR |= RCC_CR_HSION;
|
||||
|
||||
7538
F303-nolib/inc/cm/arm_math.h
Normal file
7538
F303-nolib/inc/cm/arm_math.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -833,6 +833,14 @@ void WEAK __attribute__ ((naked)) __attribute__ ((noreturn)) reset_handler(void)
|
||||
// enable 8-byte stack alignment to comply with AAPCS
|
||||
SCB->CCR |= 0x00000200;
|
||||
|
||||
/* FPU settings ------------------------------------------------------------*/
|
||||
#if (__FPU_PRESENT == 1)
|
||||
SCB->CPACR = 0x0f << 20 ; /* set CP10 and CP11 Full Access */
|
||||
nop();
|
||||
__DSB();
|
||||
__ISB();
|
||||
#endif
|
||||
|
||||
// copy initialized variables data
|
||||
while ( dst < &_edata ) { *dst++ = *src++; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user