Config File Overwritten by MikroC GUI
Posted: 13 Aug 2022 02:09
I am no MPU expert, but it seems strange to me that the MikroC GUI overwrites my .cfg file in a way that stops the MPU from functioning with HID library.
As a work around I set my .cfg file as read only. Strangly, the GUI only complains about this occasionally.
However, I would like to understand what is causing this.
I am using the HID library, so I got the .cfg from there as a starting point, since I have no idea how to configure clocks etc for HID.
I also do some config in the code. E.g.:
//----------------------------------------------------------------------------------------------
// external intr setup
GPIO_Digital_Input(&GPIOC_IDR,_GPIO_PINMASK_4); //was 1
SYSCFGEN_bit = 1; // Enable clock for alt pin functions
SYSCFG_EXTICR2 |= 0b0000000000000010; // Map external interrupt on PC4
EXTI_RTSR |= 0b0000000000010000; // Set intr on Rising edge (PC4)
EXTI_FTSR |= 0b0000000000000000; // Set intr on Falling edge (none)
EXTI_IMR |= 0b0000000000010000; // Set mask
// enable is done later
NVIC_SetIntPriority(IVT_INT_EXTI4, _NVIC_INT_PRIORITY_LVL13);
NVIC_SetIntPriority(IVT_INT_OTG_FS, _NVIC_INT_PRIORITY_LVL15); // lowest
// ----------------------------------------------------------------------------------------------
and misc timers.
But is not clear to me why the GUI wants to overwrite my .cfg file.
Presumably, something I am doing in the code causes the compler to want to change the .cfg. It just stops HID from working.
Any throughts?
As a work around I set my .cfg file as read only. Strangly, the GUI only complains about this occasionally.
However, I would like to understand what is causing this.
I am using the HID library, so I got the .cfg from there as a starting point, since I have no idea how to configure clocks etc for HID.
I also do some config in the code. E.g.:
//----------------------------------------------------------------------------------------------
// external intr setup
GPIO_Digital_Input(&GPIOC_IDR,_GPIO_PINMASK_4); //was 1
SYSCFGEN_bit = 1; // Enable clock for alt pin functions
SYSCFG_EXTICR2 |= 0b0000000000000010; // Map external interrupt on PC4
EXTI_RTSR |= 0b0000000000010000; // Set intr on Rising edge (PC4)
EXTI_FTSR |= 0b0000000000000000; // Set intr on Falling edge (none)
EXTI_IMR |= 0b0000000000010000; // Set mask
// enable is done later
NVIC_SetIntPriority(IVT_INT_EXTI4, _NVIC_INT_PRIORITY_LVL13);
NVIC_SetIntPriority(IVT_INT_OTG_FS, _NVIC_INT_PRIORITY_LVL15); // lowest
// ----------------------------------------------------------------------------------------------
and misc timers.
But is not clear to me why the GUI wants to overwrite my .cfg file.
Presumably, something I am doing in the code causes the compler to want to change the .cfg. It just stops HID from working.
Any throughts?