Skip to content

Commit

Permalink
Removed deprecated attribute on ME18 WUT. Renamed IntStatus(), Edge()…
Browse files Browse the repository at this point in the history
…, and Count(), marking them as deprecated on other devices
  • Loading branch information
crsz20 committed Dec 12, 2024
1 parent 91643c7 commit 2e1e9ee
Show file tree
Hide file tree
Showing 17 changed files with 253 additions and 52 deletions.
6 changes: 3 additions & 3 deletions Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
/* Determine if we need to snapshot the PalBb clock */
if (schTimerActive) {
/* Snapshot the current WUT value with the PalBb clock */
MXC_WUT_Store(MXC_WUT0);
MXC_WUT_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

Expand All @@ -176,7 +176,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -237,7 +237,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
postCapture = MXC_WUT_GetCount(MXC_WUT0);
dsWutTicks = postCapture - preCapture;

Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32690/Bluetooth/RF_Test/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
/* Determine if we need to snapshot the PalBb clock */
if (schTimerActive) {
/* Snapshot the current WUT value with the PalBb clock */
MXC_WUT_Store(MXC_WUT0);
MXC_WUT_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

Expand All @@ -176,7 +176,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -238,7 +238,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
postCapture = MXC_WUT_GetCount(MXC_WUT0);
dsWutTicks = postCapture - preCapture;

Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32690/FreeRTOSDemo/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask);

/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
pre_capture = MXC_WUT_GetCount(MXC_WUT0);
MXC_WUT_SetCompare(MXC_WUT0, pre_capture + wut_ticks);
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);

LED_Off(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ static struct {
void WUT0_IRQHandler(void)
{
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
MXC_WUT_Handler(MXC_WUT0);
MXC_WUT_Handler(PAL_WUT);

}
#else
void WUT1_IRQHandler(void)
{
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
MXC_WUT_Handler(MXC_WUT0);
MXC_WUT_Handler(PAL_WUT);

}
#endif
Expand All @@ -102,7 +102,7 @@ PalRtcState_t PalRtcGetState(void)
/*************************************************************************************************/
void PalRtcCompareSet(uint8_t channelId, uint32_t value)
{
MXC_WUT_SetCompare(MXC_WUT0, value);
MXC_WUT_SetCompare(PAL_WUT, value);
}

/*************************************************************************************************/
Expand All @@ -117,15 +117,15 @@ void PalRtcInit(void)
cfg.mode = MXC_WUT_MODE_COMPARE;
cfg.cmp_cnt = PAL_MAX_RTC_COUNTER_VAL;

MXC_WUT_Init(MXC_WUT0, MXC_WUT_PRES_1);
MXC_WUT_Config(MXC_WUT0, &cfg);
MXC_WUT_Init(PAL_WUT, MXC_WUT_PRES_1);
MXC_WUT_Config(PAL_WUT, &cfg);
MXC_LP_EnableWUTAlarmWakeup();

NVIC_ClearPendingIRQ(PAL_WUT_IRQn);
NVIC_EnableIRQ(PAL_WUT_IRQn);

/* Enable WUT */
MXC_WUT_Enable(MXC_WUT0);
MXC_WUT_Enable(PAL_WUT);

palRtcCb.state = PAL_RTC_STATE_READY;
}
Expand All @@ -142,7 +142,7 @@ void PalRtcInit(void)
/*************************************************************************************************/
uint32_t PalRtcCounterGet(void)
{
uint32_t count = MXC_WUT_GetCount(MXC_WUT0);
uint32_t count = MXC_WUT_GetCount(PAL_WUT);

return count;
}
Expand All @@ -168,6 +168,6 @@ void PalRtcEnableCompareIrq(uint8_t channelId)
/*************************************************************************************************/
void PalRtcDisableCompareIrq(uint8_t channelId)
{
MXC_WUT_ClearFlags(MXC_WUT0);
MXC_WUT_ClearFlags(PAL_WUT);
NVIC_DisableIRQ(PAL_WUT_IRQn);
}
28 changes: 25 additions & 3 deletions Libraries/PeriphDrivers/Include/MAX32655/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@ void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_GetFlags instead. See wut.h for more details."))) uint32_t
MXC_WUT_IntStatus(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -216,13 +224,27 @@ int MXC_WUT_GetTime(mxc_wut_regs_t *wut, uint32_t ticks, uint32_t *time, mxc_wut
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_Edge(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_WaitForEdge instead. See wut.h for more details."))) void
MXC_WUT_Edge(mxc_wut_regs_t *wut);

/**
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_WaitForEdge(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
__attribute__((deprecated("Use MXC_WUT_StoreCount instead. See wut.h for more details."))) void
MXC_WUT_Store(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
void MXC_WUT_Store(mxc_wut_regs_t *wut);
void MXC_WUT_StoreCount(mxc_wut_regs_t *wut);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
28 changes: 25 additions & 3 deletions Libraries/PeriphDrivers/Include/MAX32657/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_GetFlags instead. See wut.h for more details."))) uint32_t
MXC_WUT_IntStatus(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -214,13 +222,27 @@ int MXC_WUT_GetTime(mxc_wut_regs_t *wut, uint32_t ticks, uint32_t *time, mxc_wut
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_Edge(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_WaitForEdge instead. See wut.h for more details."))) void
MXC_WUT_Edge(mxc_wut_regs_t *wut);

/**
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_WaitForEdge(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
__attribute__((deprecated("Use MXC_WUT_StoreCount instead. See wut.h for more details."))) void
MXC_WUT_Store(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
void MXC_WUT_Store(mxc_wut_regs_t *wut);
void MXC_WUT_StoreCount(mxc_wut_regs_t *wut);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
25 changes: 22 additions & 3 deletions Libraries/PeriphDrivers/Include/MAX32665/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,14 @@ void MXC_WUT_ClearFlags(void);
* @brief Get the timer interrupt status.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(void);
__attribute__((deprecated("Use MXC_WUT_GetFlags instead. See wut.h for more details."))) uint32_t
MXC_WUT_IntStatus(void);

/**
* @brief Get the timer interrupt status.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(void);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -209,12 +216,24 @@ int MXC_WUT_GetTime(uint32_t ticks, uint32_t *time, mxc_wut_unit_t *units);
/**
* @brief Wait for an edge of the WUT count register.
*/
void MXC_WUT_Edge(void);
__attribute__((deprecated("Use MXC_WUT_WaitForEdge instead. See wut.h for more details."))) void
MXC_WUT_Edge(void);

/**
* @brief Wait for an edge of the WUT count register.
*/
void MXC_WUT_WaitForEdge(void);

/**
* @brief Store the count and snapshot values.
*/
__attribute__((deprecated("Use MXC_WUT_StoreCount instead. See wut.h for more details."))) void
MXC_WUT_Store(void);

/**
* @brief Store the count and snapshot values.
*/
void MXC_WUT_Store(void);
void MXC_WUT_StoreCount(void);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
28 changes: 25 additions & 3 deletions Libraries/PeriphDrivers/Include/MAX32680/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@ void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);
* @param wut Pointer to Wakeup Timer instance to get interrupt status from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_GetFlags instead. See wut.h for more details."))) uint32_t
MXC_WUT_IntStatus(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt status from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -216,13 +224,27 @@ int MXC_WUT_GetTime(mxc_wut_regs_t *wut, uint32_t ticks, uint32_t *time, mxc_wut
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_Edge(mxc_wut_regs_t *wut);
__attribute__((deprecated("Use MXC_WUT_WaitForEdge instead. See wut.h for more details."))) void
MXC_WUT_Edge(mxc_wut_regs_t *wut);

/**
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_WaitForEdge(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
__attribute__((deprecated("Use MXC_WUT_StoreCount instead. See wut.h for more details."))) void
MXC_WUT_Store(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
void MXC_WUT_Store(mxc_wut_regs_t *wut);
void MXC_WUT_StoreCount(mxc_wut_regs_t *wut);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
12 changes: 3 additions & 9 deletions Libraries/PeriphDrivers/Include/MAX32690/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ uint32_t MXC_WUT_GetCapture(mxc_wut_regs_t *wut);
*/
uint32_t MXC_WUT_GetCount(mxc_wut_regs_t *wut);

/**
* @brief Clear the timer interrupt.
*/
__attribute__((deprecated("Use MXC_WUT_ClearFlags instead. See wut.h for more details."))) void
MXC_WUT_IntClear(void);

/**
* @brief Clear the timer interrupt.
*/
Expand All @@ -170,7 +164,7 @@ void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);
* @brief Get the timer interrupt status.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(mxc_wut_regs_t *wut);
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -209,12 +203,12 @@ int MXC_WUT_GetTime(mxc_wut_regs_t *wut, uint32_t ticks, uint32_t *time, mxc_wut
/**
* @brief Wait for an edge of the WUT count register.
*/
void MXC_WUT_Edge(mxc_wut_regs_t *wut);
void MXC_WUT_WaitForEdge(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
*/
void MXC_WUT_Store(mxc_wut_regs_t *wut);
void MXC_WUT_StoreCount(mxc_wut_regs_t *wut);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
25 changes: 22 additions & 3 deletions Libraries/PeriphDrivers/Include/MAX78000/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ void MXC_WUT_ClearFlags(void);
* @brief Get the timer interrupt status.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_IntStatus(void);
__attribute__((deprecated("Use MXC_WUT_GetFlags instead. See wut.h for more details."))) uint32_t
MXC_WUT_IntStatus(void);

/**
* @brief Get the timer interrupt status.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(void);

/**
* @brief Set the timer compare count.
Expand Down Expand Up @@ -202,12 +209,24 @@ int MXC_WUT_GetTime(uint32_t ticks, uint32_t *time, mxc_wut_unit_t *units);
/**
* @brief Wait for an edge of the WUT count register.
*/
void MXC_WUT_Edge(void);
__attribute__((deprecated("Use MXC_WUT_WaitForEdge instead. See wut.h for more details."))) void
MXC_WUT_Edge(void);

/**
* @brief Wait for an edge of the WUT count register.
*/
void MXC_WUT_WaitForEdge(void);

/**
* @brief Store the count and snapshot values.
*/
__attribute__((deprecated("Use MXC_WUT_StoreCount instead. See wut.h for more details."))) void
MXC_WUT_Store(void);

/**
* @brief Store the count and snapshot values.
*/
void MXC_WUT_Store(void);
void MXC_WUT_StoreCount(void);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
Expand Down
Loading

0 comments on commit 2e1e9ee

Please sign in to comment.