diff --git a/Examples/MAX32665/ADC/main.c b/Examples/MAX32665/ADC/main.c index d8147e7fba..a6886a8738 100644 --- a/Examples/MAX32665/ADC/main.c +++ b/Examples/MAX32665/ADC/main.c @@ -146,20 +146,20 @@ int main(void) overflow[3] = (MXC_ADC_GetData(&adc_val[3]) == E_OVERFLOW ? 1 : 0); /* Display results on OLED display, display asterisk if overflow */ - snprintf((char *)fmtstr, sizeof((char *)fmtstr), "0: 0x%04x%s 2: 0x%04x%s", adc_val[0], + snprintf((char *)fmtstr, sizeof(fmtstr), "0: 0x%04x%s 2: 0x%04x%s", adc_val[0], overflow[0] ? "*" : " ", adc_val[2], overflow[2] ? "*" : " "); printf("%s\n", fmtstr); - snprintf((char *)fmtstr, sizeof((char *)fmtstr), "1: 0x%04x%s 3: 0x%04x%s", adc_val[1], + snprintf((char *)fmtstr, sizeof(fmtstr), "1: 0x%04x%s 3: 0x%04x%s", adc_val[1], overflow[1] ? "*" : " ", adc_val[3], overflow[3] ? "*" : " "); printf("%s\n", fmtstr); /* Determine if programmable limits on AIN1 were exceeded */ if (MXC_ADC_GetFlags() & (MXC_F_ADC_INTR_LO_LIMIT_IF | MXC_F_ADC_INTR_HI_LIMIT_IF)) { - snprintf((char *)fmtstr, sizeof((char *)fmtstr), " %s Limit on AIN0 ", + snprintf((char *)fmtstr, sizeof(fmtstr), " %s Limit on AIN0 ", (MXC_ADC_GetFlags() & MXC_F_ADC_INTR_LO_LIMIT_IF) ? "Low" : "High"); MXC_ADC_ClearFlags(MXC_F_ADC_INTR_LO_LIMIT_IF | MXC_F_ADC_INTR_HI_LIMIT_IF); } else { - snprintf((char *)fmtstr, sizeof((char *)fmtstr), " "); + snprintf((char *)fmtstr, sizeof(fmtstr), " "); } printf("%s\n", fmtstr); diff --git a/Examples/MAX32690/USB_CompositeDevice_MSC_HID/main.c b/Examples/MAX32690/USB_CompositeDevice_MSC_HID/main.c index a7fd9b89bc..b506a70e1b 100644 --- a/Examples/MAX32690/USB_CompositeDevice_MSC_HID/main.c +++ b/Examples/MAX32690/USB_CompositeDevice_MSC_HID/main.c @@ -50,6 +50,7 @@ #include "msc.h" #include "descriptors.h" #include "mscmem.h" +#include "nvic_table.h" /* **** Definitions **** */ #define EVENT_ENUM_COMP MAXUSB_NUM_EVENTS @@ -113,8 +114,17 @@ int Hid_SW_Init(void) } /******************************************************************************/ +void HID_SW_Handler(void) +{ + MXC_GPIO_Handler(MXC_GPIO_GET_IDX(hid_sw[0].port)); +} + int Hid_SW_RegisterCallback(unsigned int pb, pb_callback callback) { + if (pb != 0) { + return E_INVALID; + } + if (callback) { // Register callback MXC_GPIO_RegisterCallback(&hid_sw[pb], callback, (void *)pb); @@ -122,6 +132,7 @@ int Hid_SW_RegisterCallback(unsigned int pb, pb_callback callback) // Configure and enable interrupt MXC_GPIO_IntConfig(&hid_sw[pb], MXC_GPIO_INT_FALLING); MXC_GPIO_EnableInt(hid_sw[pb].port, hid_sw[pb].mask); + MXC_NVIC_SetVector(MXC_GPIO_GET_IRQ(MXC_GPIO_GET_IDX(hid_sw[pb].port)), HID_SW_Handler); NVIC_EnableIRQ(MXC_GPIO_GET_IRQ(MXC_GPIO_GET_IDX(hid_sw[pb].port))); } else { // Disable interrupt and clear callback MXC_GPIO_DisableInt(hid_sw[pb].port, hid_sw[pb].mask); diff --git a/Examples/MAX32690/USB_HIDKeyboard/main.c b/Examples/MAX32690/USB_HIDKeyboard/main.c index c83e1a4ce7..8b82e7651d 100644 --- a/Examples/MAX32690/USB_HIDKeyboard/main.c +++ b/Examples/MAX32690/USB_HIDKeyboard/main.c @@ -54,6 +54,7 @@ #include "enumerate.h" #include "hid_kbd.h" #include "descriptors.h" +#include "nvic_table.h" /***** Definitions *****/ #define EVENT_ENUM_COMP MAXUSB_NUM_EVENTS @@ -99,8 +100,17 @@ int Hid_SW_Init(void) } /******************************************************************************/ +void HID_SW_Handler(void) +{ + MXC_GPIO_Handler(MXC_GPIO_GET_IDX(hid_sw[0].port)); +} + int Hid_SW_RegisterCallback(unsigned int pb, pb_callback callback) { + if (pb != 0) { + return E_INVALID; + } + if (callback) { // Register callback MXC_GPIO_RegisterCallback(&hid_sw[pb], callback, (void *)pb); @@ -108,6 +118,7 @@ int Hid_SW_RegisterCallback(unsigned int pb, pb_callback callback) // Configure and enable interrupt MXC_GPIO_IntConfig(&hid_sw[pb], MXC_GPIO_INT_FALLING); MXC_GPIO_EnableInt(hid_sw[pb].port, hid_sw[pb].mask); + MXC_NVIC_SetVector(MXC_GPIO_GET_IRQ(MXC_GPIO_GET_IDX(hid_sw[pb].port)), HID_SW_Handler); NVIC_EnableIRQ(MXC_GPIO_GET_IRQ(MXC_GPIO_GET_IDX(hid_sw[pb].port))); } else { // Disable interrupt and clear callback MXC_GPIO_DisableInt(hid_sw[pb].port, hid_sw[pb].mask); diff --git a/Libraries/CMSIS/Device/Maxim/MAX32570/Include/owm_regs.h b/Libraries/CMSIS/Device/Maxim/MAX32570/Include/owm_regs.h index 82f90d27bf..a017d29ce2 100644 --- a/Libraries/CMSIS/Device/Maxim/MAX32570/Include/owm_regs.h +++ b/Libraries/CMSIS/Device/Maxim/MAX32570/Include/owm_regs.h @@ -175,7 +175,7 @@ typedef struct { #define MXC_F_OWM_CTRL_STAT_OD_SPEC_MODE_POS 4 /**< CTRL_STAT_OD_SPEC_MODE Position */ #define MXC_F_OWM_CTRL_STAT_OD_SPEC_MODE ((uint32_t)(0x1UL << MXC_F_OWM_CTRL_STAT_OD_SPEC_MODE_POS)) /**< CTRL_STAT_OD_SPEC_MODE Mask */ -#define MXC_F_OWM_CTRL_STAT_PRESENCE_DETECT_POS 5 /**< CTRL_STAT_PRESENCE_DETECT Position */ +#define MXC_F_OWM_CTRL_STAT_PRESENCE_DETECT_POS 7 /**< CTRL_STAT_PRESENCE_DETECT Position */ #define MXC_F_OWM_CTRL_STAT_PRESENCE_DETECT ((uint32_t)(0x1UL << MXC_F_OWM_CTRL_STAT_PRESENCE_DETECT_POS)) /**< CTRL_STAT_PRESENCE_DETECT Mask */ /**@} end of group OWM_CTRL_STAT_Register */ diff --git a/Libraries/PeriphDrivers/Source/OWM/owm_reva_me13.svd b/Libraries/PeriphDrivers/Source/OWM/owm_reva_me13.svd index bbee0771f3..1bb3c30b53 100644 --- a/Libraries/PeriphDrivers/Source/OWM/owm_reva_me13.svd +++ b/Libraries/PeriphDrivers/Source/OWM/owm_reva_me13.svd @@ -128,7 +128,7 @@ presence_detect Presence Pulse Detected. - [5:5] + [7:7] read-only