assign VOLATILE V2
This commit is contained in:
8
ccs/ir.c
8
ccs/ir.c
@@ -17,12 +17,13 @@ void ir_init(void) {
|
||||
}
|
||||
|
||||
void ir_read_ready() {
|
||||
P7->DIR = 0xff;
|
||||
P7->OUT &= ~0xff; /* initially offed */
|
||||
P5->OUT |= 0x08;
|
||||
P9->OUT |= 0x04;
|
||||
P7->DIR = 0xff;
|
||||
P7->OUT |= 0xff; /* init charge the caps */
|
||||
Clock_Delay1us(10);
|
||||
P7->DIR = 0x00;
|
||||
Clock_Delay1us(1000);
|
||||
P7->DIR = 0x00; /* set input */
|
||||
}
|
||||
|
||||
void ir_read_value(uint8_t *value) {
|
||||
@@ -40,6 +41,7 @@ void test_ir(void) {
|
||||
|
||||
while (1) {
|
||||
ir_ready_ready();
|
||||
Clock_Delay1us(1000); // 1ms
|
||||
ir_read_value(&ir_value);
|
||||
print_binary(ir_value);
|
||||
printf("\n");
|
||||
|
||||
Reference in New Issue
Block a user