Closed goutx2 closed 4 years ago
The pins structure has no ch member.
It should cause a compilation error, but it is strange that it does not.
pins.cs is set here.
https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/tft.c#L604
The following two lines are not required.
https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/tft.c#L605 https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/tft.c#L606
I'll fix this issues. Thank you for report.
@goutx2 pin.ch is SPI Channel.
https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/spilib.c#L137
https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/spilib.c#L145
No need to change.
when i change it to cs it work perfectly i dont know why but it work I use 8 bits paralell not spi
8 bit paralell uses the following structure:
typedef struct {
int rst;
int cs;
int rs;
int wr;
int rd;
int d0;
int d1;
int d2;
int d3;
int d4;
int d5;
int d6;
int d7;
} TFTPin;
This structure has no ch members. But if pin.conf has "CH=xx", it will be set as a ch member and destroy the memory.
https://github.com/nopnop2002/wiringpi-tft-tool/blob/master/tft.c#L605
Is "CH=XX" in your pin.conf? ?
You have to change line 606 ch to cs sscanf(buff, "CH=%d", &(pin->ch)); to sscanf(buff, "CH=%d", &(pin->cs));