library for implementing ir transmission
Diff: XMIT_IR.h
- Revision:
- 3:823708586b3e
- Parent:
- 2:2eb0a3a29b5b
- Child:
- 4:55946953c6e3
--- a/XMIT_IR.h Sat Oct 06 02:45:52 2012 +0000 +++ b/XMIT_IR.h Sat Oct 06 11:34:30 2012 +0000 @@ -14,18 +14,22 @@ IRTransmitter(PinName TX, PinName PWM, PinName RX, int data_buff_len, void (*fptr)(void)); ~IRTransmitter(); void MakePacket(char* data,int len); - char ReadPacket(char* data); + char ReadPacket(char* data, int len); void isr_uartrx(void); void isr(char data); +private: + char packet_is_valid(int data_len); + void update_packet_buffer(char new_data, int data_len); + public: Mail<char,64> ir_data_mailbox; private: Serial* ir_serial; PwmOut* ir_pwm; - char* data_buffer_out; - char* data_buffer_in; + char* packet_buffer_out; + char* packet_buffer_in; };