I am working on a project where I am receiving serial data on UART6_RX. This works perfectly fine.
However, when I add a touchscreen button to the screen and in the main while loop check if it is touched, the UART_RX doesn't receive any data anymore. I've got the feeling that it has something to do with interrupts.
I currently have the following code:
int main()
{
device.baud(31250);
lcd.Clear(BACK_COLOR);
Button firstButton(lcd, ts, 10, Y0, btnWidth, btnHeight,LCD_COLOR_RED, BACK_COLOR, "My First Button", Font24);
while(1) {
if (firstButton.Touched()) //If I remove this if statement, everything works perfectly.
{
int n = 10;
}
// __disable_irq(); //Tried this, but without succes
if (device.readable()) {
char cReceivedByte = device.getc();
unsigned long result= doSomethingAmazing(cOntvangenByte);
char buf[10];
sprintf(buf, "%05lu\r\n", result);
lcd.SetBackColor(LCD_COLOR_GREEN);
lcd.SetTextColor(LCD_COLOR_WHITE);
lcd.SetFont(&Font24);
lcd.DisplayStringAt(270, LINE(5), (uint8_t *)buf, LEFT_MODE);
}
// __enable_irq();
}
}
I using the ARM - mbed compiler and am running it on the following dev board: - STM32F7-Discovery
Who knows what is going on and how I can solve it?
Thanks a million times,
Alex