| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * @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 -
- * <a href="https://mengze.top/MZ-ATY_VCJS">
- * https://mengze.top/MZ-ATY_VCJS</a>
- * - CC 4.0 BY-NC-SA -
- * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
- * - 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 *********************************/
|