mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2026-01-06 21:42:47 +00:00
Abbreviated (Panasonic) address handling
This commit is contained in:
63
IRremote.h
63
IRremote.h
@@ -69,42 +69,47 @@ int MATCH (int measured, int desired) ;
|
|||||||
// #define TEST
|
// #define TEST
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
enum decode_type_t {
|
// An enumerated list of all supported formats
|
||||||
UNKNOWN = -1,
|
//
|
||||||
UNUSED = 0,
|
typedef
|
||||||
NEC = 1,
|
enum {
|
||||||
SONY = 2,
|
UNKNOWN = -1,
|
||||||
RC5 = 3,
|
UNUSED = 0,
|
||||||
RC6 = 4,
|
NEC = 1,
|
||||||
DISH = 5,
|
SONY = 2,
|
||||||
SHARP = 6,
|
RC5 = 3,
|
||||||
PANASONIC = 7,
|
RC6 = 4,
|
||||||
JVC = 8,
|
DISH = 5,
|
||||||
SANYO = 9,
|
SHARP = 6,
|
||||||
MITSUBISHI = 10,
|
PANASONIC = 7,
|
||||||
SAMSUNG = 11,
|
JVC = 8,
|
||||||
LG = 12,
|
SANYO = 9,
|
||||||
WHYNTER = 13,
|
MITSUBISHI = 10,
|
||||||
AIWA_RC_T501 = 14,
|
SAMSUNG = 11,
|
||||||
};
|
LG = 12,
|
||||||
|
WHYNTER = 13,
|
||||||
|
AIWA_RC_T501 = 14,
|
||||||
|
}
|
||||||
|
decode_type_t;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Results returned from the decoder
|
// Results returned from the decoder
|
||||||
class decode_results {
|
//
|
||||||
public:
|
class decode_results
|
||||||
decode_type_t decode_type; // NEC, SONY, RC5, UNKNOWN
|
{
|
||||||
union { // This is used for decoding Panasonic and Sharp data
|
public:
|
||||||
unsigned int panasonicAddress;
|
decode_type_t decode_type; // UNKNOWN, NEC, SONY, RC5, ...
|
||||||
unsigned int sharpAddress;
|
unsigned int address; // Used by Panasonic & Sharp
|
||||||
};
|
unsigned long value; // Decoded value
|
||||||
unsigned long value; // Decoded value
|
int bits; // Number of bits in decoded value
|
||||||
int bits; // Number of bits in decoded value
|
volatile unsigned int *rawbuf; // Raw intervals in 50uS ticks
|
||||||
volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
|
int rawlen; // Number of records in rawbuf.
|
||||||
int rawlen; // Number of records in rawbuf.
|
int overflow; // true iff IR raw code too long
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Decoded value for NEC when a repeat code is received
|
// Decoded value for NEC when a repeat code is received
|
||||||
|
//
|
||||||
#define REPEAT 0xffffffff
|
#define REPEAT 0xffffffff
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ long IRrecv::decodePanasonic (decode_results *results)
|
|||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
results->value = (unsigned long)data;
|
results->value = (unsigned long)data;
|
||||||
results->panasonicAddress = (unsigned int)(data >> 32);
|
results->address = (unsigned int)(data >> 32);
|
||||||
results->decode_type = PANASONIC;
|
results->decode_type = PANASONIC;
|
||||||
results->bits = PANASONIC_BITS;
|
results->bits = PANASONIC_BITS;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user