Skip to content

Commit

Permalink
Fix for 5XL build issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-7VKKLTO\ian committed Jan 23, 2025
1 parent d887cc7 commit 20d4433
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/binmode/irtoy-air.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ typedef struct _IR_PULSE {
static void ir_rx_pulse_packet(IR_PULSE *pulse_buffer, bool is_mark, uint16_t pulse_length){
if(is_mark){
pulse_buffer->identifier_mark_or_space = '+'; //mark
pulse_length = pulse_length |= 0x0001; //always set low bit for mark
//pulse_length = pulse_length |= 0x0001; //always set low bit for mark
}else{
pulse_buffer->identifier_mark_or_space = '-'; //space
pulse_length = pulse_length &= 0xfffe; //always clear low bit for space
//pulse_length = pulse_length &= 0xfffe; //always clear low bit for space
}
pulse_buffer->pulse_length_msb = (uint8_t)(pulse_length >> 8);
pulse_buffer->pulse_length_lsb = (uint8_t)(pulse_length);
Expand All @@ -194,11 +194,24 @@ static void ir_rx_modulation_packet(IR_MODULATION *modulation_buffer, uint16_t p
}

/*
$36:420,280,168,280,168,616,168,448,168,448,168,280,168,280,168,280,168,280,168,616,168,616,168,448,168,616,168,280,168,280,168,280,168,448,168,90804,;
$36:420,280,168,280,420,;
$ start character
: carrier frequency / 1000 (this comes from the learner sensor)
ASCII decimals representing the lengths of pulse and no-pulse in uS (anyone think that 90804 is a timeout?). CSV formatted, including the final value
ASCII decimals representing the lengths of pulse and no-pulse in uS CSV formatted, including the final value
; Terminated with ;
$ - Start AIR packet
36 - Modulation frequency in kHz
: - Start of IR pulse timing data (in us), beginning with MARK (IR pulse)
900 - Length of first IR MARK/pulse (in us)
, - Each value separated by a comma, including after the final timeout
850 - Length of first IR SPACE/no pulse (in us)
, - Each value separated by a comma, including after the final timeout
… More MARK/SPACE timing pairs
65535 - Final timeout, when no IR MARK has been sensed in 65535us
, - Remember the comma after the final timing
; - Terminated with a semicolon
*/
// Use PIO to count 1uS ticks for each pulse and no-pulse, with timeout?
void irtoy_air_service(void){
Expand All @@ -216,7 +229,7 @@ void irtoy_air_service(void){

IR_MODULATION modulation;
modulation.identifier_modulation = 'M';
modulation.measured_sample_count = 5;
modulation.measured_sample_count = 1;
modulation.always_LF = '\n';

while(true){
Expand All @@ -227,7 +240,7 @@ void irtoy_air_service(void){
continue;
}else if(send_id){
send_id=false;
const char version[] = {'\n','!','B','P',' ','V', (BP_VER + 0x30), HARDWARE_VERSION, FIRMWARE_VERSION_H, FIRMWARE_VERSION_L,'!','\n', 0x00};
const char version[] = {'\n','!','B','P',' ','V', HARDWARE_VERSION, FIRMWARE_VERSION_H, FIRMWARE_VERSION_L,'!','\n', 0x00};
for (uint32_t i = 0; i < strlen(version); i++) {
bin_tx_fifo_put(version[i]);
}
Expand Down

0 comments on commit 20d4433

Please sign in to comment.