recv_data should appear to as 'sstt' when it is full with two data.
Both upper and lower byte should be checked.
recv_data = 0xFFFF;
}
+#define LO8(w) (*((uint8_t *)&(w)))
+#define HI8(w) (*(((uint8_t *)&(w))+1))
// NOTE: With this ISR data line can be read within 2us after clock falling edge.
// To read data line early as possible:
// write naked ISR with asembly code to read the line and call C func to do other job?
ibmpc_error = IBMPC_ERR_FF;
goto ERROR;
}
- if ((recv_data & 0xFF00) != 0xFF00) {
+ if (HI8(recv_data) != 0xFF && LO8(recv_data) != 0xFF) {
// buffer full
ibmpc_error = IBMPC_ERR_FULL;
goto ERROR;