Skip to content

Commit

Permalink
Merge branch 'main' into fix/max32567-no-unaligned
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-gillespie committed Dec 17, 2024
2 parents e08a0c9 + 1b95c3c commit fd49d7d
Show file tree
Hide file tree
Showing 118 changed files with 4,766 additions and 4,191 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/scripts/zephyr-hal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ rm -rf ${hal_adi}/MAX/

# Create parent folder
mkdir -p ${hal_adi}/MAX/Libraries/CMSIS
mkdir -p ${hal_adi}/MAX/Libraries/MAXUSB/include
mkdir -p ${hal_adi}/MAX/Libraries/MAXUSB/src
mkdir -p ${hal_adi}/MAX/Libraries/PeriphDrivers

# Copy zephyr wrappers, system files and cmakefiles
Expand All @@ -38,11 +40,19 @@ cp -rf ${msdk}/Libraries/CMSIS/Include ${hal_adi}/MAX/Libraries/CMSIS/
cp -rf ${msdk}/Libraries/PeriphDrivers/Include ${hal_adi}/MAX/Libraries/PeriphDrivers/
cp -rf ${msdk}/Libraries/PeriphDrivers/Source ${hal_adi}/MAX/Libraries/PeriphDrivers/

# Copy MAXUSB folder
cp -rf ${msdk}/Libraries/MAXUSB/include/core ${hal_adi}/MAX/Libraries/MAXUSB/include/
cp -rf ${msdk}/Libraries/MAXUSB/src/core ${hal_adi}/MAX/Libraries/MAXUSB/src/

# Remove unneeded files
rm -rf ${hal_adi}/MAX/Libraries/CMSIS/Device/Maxim/GCC
rm -rf ${hal_adi}/MAX/Libraries/CMSIS/Device/Maxim/MAX*/Source/IAR
rm -rf ${hal_adi}/MAX/Libraries/CMSIS/Device/Maxim/MAX*/Source/GCC
rm -rf ${hal_adi}/MAX/Libraries/CMSIS/Device/Maxim/MAX*/Source/ARM
rm -rf ${hal_adi}/MAX/Libraries/MAXUSB/include/core/arm
rm -rf ${hal_adi}/MAX/Libraries/MAXUSB/include/core/maxq
rm -rf ${hal_adi}/MAX/Libraries/MAXUSB/src/core/arm
rm -rf ${hal_adi}/MAX/Libraries/MAXUSB/src/core/maxq

# Check either dirty or clean
cd ${hal_adi}
Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32655/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 @@ -239,7 +239,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
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/MAX32655/Bluetooth/RF_Test/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,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
4 changes: 2 additions & 2 deletions Examples/MAX32655/FreeRTOSDemo/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,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
2 changes: 1 addition & 1 deletion Examples/MAX32655/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int freertos_permit_tickless(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT0);
MXC_WUT_ClearFlags(MXC_WUT0);
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32655/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT0);
MXC_WUT_ClearFlags(MXC_WUT0);
}

// *****************************************************************************
Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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_WUT_StoreCount();
preCapture = MXC_WUT_GetCount();
schUsec = PalTimerGetExpTime();

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

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

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/Bluetooth/BLE_FreeRTOS/stack_dats.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static void mainWsfInit(void)
/*************************************************************************************************/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
NVIC_ClearPendingIRQ(WUT_IRQn);
MXC_WUT_Handler();
PalTimerIRQCallBack();
Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32665/Bluetooth/RF_Test/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,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_WUT_StoreCount();
preCapture = MXC_WUT_GetCount();
schUsec = PalTimerGetExpTime();

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

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

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

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

LED_Off(SLEEP_LED);

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void turnOffUnused(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/***** Functions *****/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
}

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

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

LED_Off(1);

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32680/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ int freertos_permit_tickless(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT);
MXC_WUT_ClearFlags(MXC_WUT);
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32680/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void setTrigger(int waitForTrigger)

void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT);
MXC_WUT_ClearFlags(MXC_WUT);
}

// *****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static void trimStart(void)
extern void wutTrimCb(int err);

/* Start the 32 kHz crystal trim procedure */
err = MXC_WUT_TrimCrystalAsync(wutTrimCb);
err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
if (err != E_NO_ERROR) {
APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err);
}
Expand Down
16 changes: 8 additions & 8 deletions Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
int freertos_permit_tickless(void)
{
/* Can not disable BLE DBB and 32 MHz clock while trim procedure is ongoing */
if (MXC_WUT_TrimPending() != E_NO_ERROR) {
if (MXC_WUT_TrimPending(MXC_WUT0) != E_NO_ERROR) {
return E_BUSY;
}

Expand Down Expand Up @@ -160,8 +160,8 @@ 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();
preCapture = MXC_WUT_GetCount();
MXC_WUT_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

/* Adjust idleTicks for the time it takes to restart the BLE hardware */
Expand All @@ -176,8 +176,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge();
preCapture = MXC_WUT_GetCount();
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)

if (schTimerActive) {
/* Restore the BB counter */
MXC_WUT_RestoreBBClock(BB_CLK_RATE_HZ);
MXC_WUT_RestoreBBClock(MXC_WUT0, BB_CLK_RATE_HZ);

/* Restart the BLE scheduler timer */
dsWutTicks = MXC_WUT->cnt - preCapture;
Expand All @@ -237,8 +237,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

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

/*
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void trim32k(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
if (MXC_WUT_TrimCrystalAsync(wutTrimCb) != E_NO_ERROR) {
if (MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb) != E_NO_ERROR) {
APP_TRACE_INFO0("Error with 32k trim");
} else {
while (!wutTrimComplete) {}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_datc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int main(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
MXC_WUT_TrimCrystalAsync(wutTrimCb);
MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
while (!wutTrimComplete) {}

/* Shutdown the 32 MHz crystal and the BLE DBB */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void trimStart(void)
extern void wutTrimCb(int err);

/* Start the 32 kHz crystal trim procedure */
err = MXC_WUT_TrimCrystalAsync(wutTrimCb);
err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
if (err != E_NO_ERROR) {
APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err);
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_dats/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int main(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
MXC_WUT_TrimCrystalAsync(wutTrimCb);
MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
while (!wutTrimComplete) {}

/* Shutdown the 32 MHz crystal and the BLE DBB */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_fit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int main(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
MXC_WUT_TrimCrystalAsync(wutTrimCb);
MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
while (!wutTrimComplete) {}

/* Shutdown the 32 MHz crystal and the BLE DBB */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ int main(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
MXC_WUT_TrimCrystalAsync(wutTrimCb);
MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
while (!wutTrimComplete) {}

/* Shutdown the 32 MHz crystal and the BLE DBB */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static void trimStart(void)
extern void wutTrimCb(int err);

/* Start the 32 kHz crystal trim procedure */
err = MXC_WUT_TrimCrystalAsync(wutTrimCb);
err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
if (err != E_NO_ERROR) {
APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err);
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int main(void)

/* Execute the trim procedure */
wutTrimComplete = 0;
MXC_WUT_TrimCrystalAsync(wutTrimCb);
MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb);
while (!wutTrimComplete) {}

/* Stop here to measure the 32 kHz clock */
Expand Down
Loading

0 comments on commit fd49d7d

Please sign in to comment.