void app_main(void) { init(); int button= BUTTON_NONE; char buf0[128]; int scroll_pos; //GPIOD_OUTPUT_EN |= 0x70; //GPIOD_OUTPUT_VAL |= 0x70; while(true){ button = button_read_device(); if (button == BUTTON_POWER){ sleep(HZ); GPIOF_OUTPUT_VAL &=~ 0x20; } if ( GPIOD_INPUT_VAL & 0x20 ) { GPIOD_OUTPUT_VAL &=~ 0x40; GPIOD_OUTPUT_VAL &=~ 0x80; udelay(50); scroll_pos = adc_scan(ADC_SCROLLPAD); //GPIOD_OUTPUT_VAL |= 0x40; snprintf(buf0, sizeof(buf0), "SCROLL: %2x",scroll_pos); } lcd_puts(0, 1, buf0); lcd_update(); } //browse_root(); }