Files
LFP_48V_mBMS_FW/mBMS_APP_V3117/SYSTEM/sys/sys.c

51 lines
1.4 KiB
C

#include "sys.h"
//////////////////////////////////////////////////////////////////////////////////
//This program is for educational purposes only, without the author's permission, may not be used for any other purpose
//ALIENTEK STM32F407 Development Board
//System clock initialize
///GPIO set clock set/break management
//Hot Atom@ALIENTEK
//Technical Forum:www.openedv.com
//Date created:2014/5/2
//Version: V1.0
//All rights reserved pirated reserved.
//Copyright(C) Guangzhou wing electronic technology limited company 2014-2024
//All rights reserved
//********************************************************************************
//Modify the description
//No
//////////////////////////////////////////////////////////////////////////////////
//THUMB instructions compilation is not supported inline
//Uses the following methods to achieve implementation of Assembly instructions WFI
__asm void WFI_SET(void)
{
WFI;
}
//Diable all interrupts (but not fault and NMI interrupt)
__asm void INTX_DISABLE(void)
{
CPSID I
BX LR
}
//Enable all the interrupts
__asm void INTX_ENABLE(void)
{
CPSIE I
BX LR
}
//Setting the stack address
//addr:The top of the stack address
__asm void MSR_MSP(u32 addr)
{
MSR MSP, r0 //set Main Stack value
BX r14
}
//Soft reset
void Sys_Soft_Reset(void)
{
SCB->AIRCR =0X05FA0000|(u32)0x04;
}