/**
* @file HW_RESET_ATY.c
*
* @param Project DEVICE_GENERAL_ATY_LIB
*
* @author ATY
*
* @copyright
* - Copyright 2017 - 2023 MZ-ATY
* - This code follows:
* - MZ-ATY Various Contents Joint Statement -
*
* https://mengze.top/MZ-ATY_VCJS
* - CC 4.0 BY-NC-SA -
*
* https://creativecommons.org/licenses/by-nc-sa/4.0/
* - Your use will be deemed to have accepted the terms of this statement.
*
* @brief Familiar functions of soft reset for CMSIS device
*
* @version
* - 1_01_221029 > ATY
* -# Preliminary version, first Release
********************************************************************************
*/
#ifndef __HW_RESET_ATY_C
#define __HW_RESET_ATY_C
#include "HW_RESET_ATY.h"
/******************************* For user *************************************/
/******************************************************************************/
/**
* @brief reset chip
*/
__WEAK_ATY void SoftReset(void)
{
#if defined(__STC51_ATY)
IAP_CONTR |= 0x60; // @STCISP# Auto ISP Flash Download
#elif defined(__HC32_ATY) || \
defined(__STM32_SPL_ATY) || \
defined(__STM32_HAL_ATY)|| \
defined(__STM32_LL_ATY)
// defined(__ICCARM__) ||
// defined(__CC_ARM)
// for all CMSIS devices
__set_FAULTMASK(1); // close all IT
__NVIC_SystemReset(); // reset
#endif
}
#endif /* __HW_RESET_ATY_C */
/******************************** End Of File *********************************/