Beispiel #1
0
/**
 * De-assert the IR LED. This happens between symbols and words. When using
 * positive polarity, the LED is off while de-asserted. Otherwise, it is on.
 */
void ir_led_deassert() {
  if (IR_POSITIVE_POLARITY) {
    ir_led_off();
  } else {
    ir_led_on();
  }
}
Beispiel #2
0
void ir_range_blast(uint8_t power){
	//int32_t times[16] = {0};
	//times[0] = get_time();
	while((get_time()-rnbCmdSentTime)<POST_BROADCAST_DELAY);
	//times[1] = get_time();
	uint32_t pre_sync_op = get_time();
	set_all_ir_powers(256);	
	ATOMIC_BLOCK(ATOMIC_RESTORESTATE){		
		while((get_time() - pre_sync_op) < TIME_FOR_SET_IR_POWERS);
		//times[2] = get_time();
		for(uint8_t dir = 0; dir < 6; dir++){
			pre_sync_op = get_time();
			//set_red_led(255);
			//times[2*dir+3] = pre_sync_op;			
			ir_led_on(dir);
			while((get_time() - pre_sync_op) < TIME_FOR_GET_IR_VALS);
			ir_led_off(dir);
			//times[2*dir+4] = get_time();				
			//set_red_led(0);					
			delay_ms(DELAY_BETWEEN_RB_TRANSMISSIONS);
		}
	}
	//times[15] = get_time();
	//printf("B\r\n");
	//printf("T: %lu\r\n\t", times[0]-rnbCmdSentTime+8);
	//for(uint8_t i=1; i<16;i++){
		//printf("%hu ", (uint8_t)(times[i]-times[i-1]));
	//}
	//printf("\r\n");
}