summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Schär <[email protected]>2022-07-28 13:11:15 +0200
committerhathach <[email protected]>2024-04-09 12:14:27 +0700
commit385611c5a9157569205986550022dee090f26c2f (patch)
treeacbc7a85acda55f7a88936294aae2754178b45cd /examples
parent5c7876d4444de25942778728d377ec77f74a75dd (diff)
Revert "Fixed behavior of the PRCR register. Previous write protection will be recovered."
This reverts commit 4d7296109e31690972d8cf09e6138131938cb0ed.
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_freertos/src/freertos_hook.c3
-rw-r--r--examples/device/hid_composite_freertos/src/freertos_hook.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/device/cdc_msc_freertos/src/freertos_hook.c b/examples/device/cdc_msc_freertos/src/freertos_hook.c
index 3cd27e08c..ab885947c 100644
--- a/examples/device/cdc_msc_freertos/src/freertos_hook.c
+++ b/examples/device/cdc_msc_freertos/src/freertos_hook.c
@@ -99,10 +99,9 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, Stack
void vApplicationSetupTimerInterrupt(void)
{
/* Enable CMT0 */
- unsigned short oldPRCR = SYSTEM.PRCR.WORD;
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = oldPRCR;
+ SYSTEM.PRCR.WORD = (0xA5u<<8);
CMT0.CMCNT = 0;
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
diff --git a/examples/device/hid_composite_freertos/src/freertos_hook.c b/examples/device/hid_composite_freertos/src/freertos_hook.c
index 3cd27e08c..ab885947c 100644
--- a/examples/device/hid_composite_freertos/src/freertos_hook.c
+++ b/examples/device/hid_composite_freertos/src/freertos_hook.c
@@ -99,10 +99,9 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, Stack
void vApplicationSetupTimerInterrupt(void)
{
/* Enable CMT0 */
- unsigned short oldPRCR = SYSTEM.PRCR.WORD;
SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = oldPRCR;
+ SYSTEM.PRCR.WORD = (0xA5u<<8);
CMT0.CMCNT = 0;
CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);