assign VOLATILE V2

This commit is contained in:
2025-12-10 02:26:47 +09:00
parent 2ca19bf287
commit 3d8b12c321
14 changed files with 348 additions and 888 deletions

View File

@@ -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");