Commit 754a0cfb authored by Max Becker's avatar Max Becker
Browse files
parents 3c8b2684 68ad131c
......@@ -163,7 +163,7 @@ ISR(USI_OVERFLOW_VECTOR) {
* Address mode: check address and send ACK (and next USI_SLAVE_SEND_DATA) if OK, else reset USI
*/
case USI_SLAVE_CHECK_ADDRESS:
// If adress is either 0 or own address
// If address is either 0 or own address
if (USIDR == 0 || (USIDR >> 1) == slave_address) {
if (USIDR & 0x01) {
// Master Write Data Mode - Slave transmit
......
......@@ -21,7 +21,7 @@
#define STATUS_PAUSED 0x01
#define STATUS_TRANSMIT 0x02 //The transmit is supposed to be enabled while the detector is in this state
//These "addresses" are used to retrieve the received and decoded IR signal. Only read them while status is STATUS_TRANSMIT otherwise the returned value is I2C_ERROR_BYTE
//These "addresses" are used to retrieve the received and decoded IR signal. Only read them while detector_status is STATUS_TRANSMIT otherwise the returned value is I2C_ERROR_BYTE
#define I2C_GET_ALL 0x01 //Returns I2C_ALL_OK
#define I2C_ALL_OK 0x01
#define I2C_ID_GET 0x02 //Stores decoded player flag (f) and id (i) and the byte parity bit (p) 0bp00fiiii
......
......@@ -26,7 +26,6 @@ void setupIRIn(void) {
}
ISR(IR_IN_TIMER_INTR_NAME) {
uint8_t irdata1 = RECEIVER_BYTE_ONE;
......@@ -47,6 +46,8 @@ ISR(IR_IN_TIMER_INTR_NAME) {
//Increase tick counter
irparams.timer++;
if (irparams.rawlen >= RAWBUF) irparams.rcvstate = STATE_OVERFLOW ; // Buffer overflow
//Switch: about 200 bytes
switch (irparams.rcvstate) {
......@@ -185,7 +186,7 @@ uint8_t decode(decode_results *results) {
DISABLE_IR_IN_INTR;
uint8_t result=decodeData(results) ? 1 : 2;
ENABLE_IR_IN_INTR;
return result; //TODO handle overflow properly
return result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment