Fixed behavior of the PRCR register. Previous write protection will be recovered.
This commit is contained in:
2
.idea/cmake.xml
generated
2
.idea/cmake.xml
generated
@@ -75,7 +75,7 @@
|
|||||||
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
||||||
<configuration PROFILE_NAME="stm32u5a5nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u5a5nucleo -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="stm32u5a5nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u5a5nucleo -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra2a1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra2a1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra2a1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra2a1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra4m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra4m1" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||||
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
||||||
|
@@ -99,9 +99,10 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, Stack
|
|||||||
void vApplicationSetupTimerInterrupt(void)
|
void vApplicationSetupTimerInterrupt(void)
|
||||||
{
|
{
|
||||||
/* Enable CMT0 */
|
/* Enable CMT0 */
|
||||||
|
unsigned short oldPRCR = SYSTEM.PRCR.WORD;
|
||||||
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
|
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
|
||||||
MSTP(CMT0) = 0;
|
MSTP(CMT0) = 0;
|
||||||
SYSTEM.PRCR.WORD = (0xA5u<<8);
|
SYSTEM.PRCR.WORD = oldPRCR;
|
||||||
|
|
||||||
CMT0.CMCNT = 0;
|
CMT0.CMCNT = 0;
|
||||||
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
|
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
|
||||||
|
@@ -99,9 +99,10 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, Stack
|
|||||||
void vApplicationSetupTimerInterrupt(void)
|
void vApplicationSetupTimerInterrupt(void)
|
||||||
{
|
{
|
||||||
/* Enable CMT0 */
|
/* Enable CMT0 */
|
||||||
|
unsigned short oldPRCR = SYSTEM.PRCR.WORD;
|
||||||
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
|
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
|
||||||
MSTP(CMT0) = 0;
|
MSTP(CMT0) = 0;
|
||||||
SYSTEM.PRCR.WORD = (0xA5u<<8);
|
SYSTEM.PRCR.WORD = oldPRCR;
|
||||||
|
|
||||||
CMT0.CMCNT = 0;
|
CMT0.CMCNT = 0;
|
||||||
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
|
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
#define TU_VERIFY_STATIC _Static_assert
|
#define TU_VERIFY_STATIC _Static_assert
|
||||||
#elif defined(__CCRX__)
|
#elif defined(__CCRX__)
|
||||||
#define TU_VERIFY_STATIC(const_expr, _mess) typedef char TU_XSTRCAT(Line, __LINE__)[(const_expr) ? 1 : 0];
|
#define TU_VERIFY_STATIC(const_expr, _mess) typedef char TU_XSTRCAT3(Line, __LINE__, _TU_COUNTER_)[(const_expr) ? 1 : 0];
|
||||||
#else
|
#else
|
||||||
#define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
|
#define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user