Hi,
I tried to edit Blinky example so that not only an LED blinks every second, but it has to have user switch on GIOA7 pressed ON as well. I used same Halcogen generated files as for working Blinkiy and edit it. No success and no compiler error eider.
Code is:
void main(void)
{
/* USER CODE BEGIN (3) */
/* Initialize RTI driver */
rtiInit();
/* Set high end timer GIO port hetPort pin direction to all output(0xFFFFFFF), all output except gioa7 - input (0xFFFFFF7F) */
gioSetDirection(hetPORT1, 0xFFFFFF7F);
/* Enable RTI Compare 0 interrupt notification */
rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
/* Enable IRQ - Clear I flag in CPS register */
/* Note: This is usually done by the OS or in an svc dispatcher */
_enable_IRQ();
/* Start RTI Counter Block 0 */
rtiStartCounter(rtiCOUNTER_BLOCK0);
/* Run forever */
while(1);
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
/* Note-You need to remove rtiNotification from notification.c to avoid redefinition */
void rtiNotification(uint32 notification)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* Blink is hapening only id User Switch is pressed */
/* Toggle HET pin 8 , if pin 7 (set as input) is high*/
gioSetPort(hetPORT1, (gioGetPort(hetPORT1) ^ 0x00000100) & (gioGetPort(hetPORT1) ^ 0x00000080));
}
/* USER CODE END */
How this could be achieved?
Same time, I found video: https://www.youtube.com/watch?v=Kih2YKvk8Cw where at the end, guy mentiones that the original code is from TI. Where do you have this example, and is there more?