Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 1 month ago.
InterruptIn breaks SPI_TFT_ILI9341 (no printf inside callback)
I'm having a problem with using an interrupt while also using the SPI_TFT_ILI9341 library with my FRDM-KL25Z. The code below works until I uncomment line 7 ("InterruptIn doThing(PTB19);") - at which point I get an unchanging, white screen.
This is obviously just test code, to illustrate the problem (and to prove to myself that it's not isolated to my actual project).
Is this a bug, or am I missing something?
Many thanks in advance.
#include "mbed.h"
#include "SPI_TFT_ILI9341.h"
#include "Arial12x12.h"
DigitalOut toDoPin(PTB18);
//InterruptIn doThing(PTB19);
SPI_TFT_ILI9341 TFT(PTC7, PTC6, PTD1, PTE31, PTE24, PTE25, "TFT"); //mosi, miso, sclk, cs, reset, dc
void display_setup(void){
TFT.set_orientation(1);
TFT.background(Black);
TFT.foreground(White);
TFT.cls();
}
void update_display(void){
TFT.set_font((unsigned char*) Arial12x12);
TFT.foreground(Red);
TFT.locate(25,30);
TFT.printf("TEST");
}
void toDo(void){
toDoPin = !toDoPin;
}
int main() {
// doThing.rise(&toDo);
display_setup();
while (1){
update_display();
}
}