Esempio n. 1
0
status_t
console_init(void)
{
	update_screen_size();
	console_hide_cursor();
	console_clear_screen();

	// enable stdio functionality
	stdin = (FILE *)&sInput;
	stdout = stderr = (FILE *)&sOutput;

	return B_OK;
}
Esempio n. 2
0
static bool
debug_menu_save_syslog(Menu* menu, MenuItem* item)
{
	Directory* volume = (Directory*)item->Data();

	console_clear_screen();

	save_syslog_to_volume(volume);

	printf("\nPress any key to continue\n");
	console_wait_for_key();

	return true;
}
Esempio n. 3
0
/**
 * Initializes the DBGU and ISO7816 driver, and starts some tests.
 * \return Unused (ANSI-C compatibility)
 */
extern int main( void )
{
    uint8_t Atr[MAX_ATR_SIZE] ;
    uint8_t size ;

	/* Disable watchdog */
	wdt_disable();

	/* Disable all PIO interrupts */
	pio_reset_all_it();

	/* Configure console */
	board_cfg_console();
	console_clear_screen();
	console_reset_cursor();

	/* Configure PIT. Must be always ON, used for delay */
	printf("Configure PIT \n\r");
	timer_configure(BLINK_PERIOD);

    printf( "-- USART ISO7816 Example %s --\n\r", SOFTPACK_VERSION ) ;
    printf( "-- %s\n\r", BOARD_NAME ) ;
    printf( "-- Compiled: %s %s --\n\r", __DATE__, __TIME__ ) ;

#ifdef CONFIG_HAVE_PMIC_ACT8945A
	pio_configure(act8945a_pins, ARRAY_SIZE(act8945a_pins));
	if (act8945a_configure(&act8945a, &act8945a_twid)) {
		act8945a_set_regulator_voltage(&act8945a, 6, 2500);
		act8945a_enable_regulator(&act8945a, 6, true);
	} else {
		printf("--E-- Error initializing ACT8945A PMIC\n\r");
	}
#endif

	/* PIO configuration for LEDs */
	printf("Configure LED PIOs.\n\r");
	_configure_leds();
	led_set(LED_BLUE);
	timer_wait(500);
	led_clear(LED_BLUE);
	led_status[LED_BLUE] = 1;

	/* PIO configuration for Button, use to simulate card detection. */
	printf("Configure buttons with debouncing.\n\r");
	_configure_buttons();

	/* Configure Pios usart*/
	pio_configure(&pins_com2[0], ARRAY_SIZE(pins_com2));

	/* Init ISO7816 interface */
    iso7816_init(&iso7816_desc, &iso7816_opt);

	/* Warm reset */
    iso7816_warm_reset(&iso7816_desc);
	/*  Read ATR */
    memset( Atr, 0, sizeof(Atr) ) ;
    iso7816_get_data_block_ATR(&iso7816_desc, Atr, &size );
    /*  Decode ATR */
    iso7816_decode_ATR(Atr);

    /*  Allow user to send some commands */
    _send_receive_commands(&iso7816_desc);

	printf("\n\r Exit App \n\r");
    while (1) ;
}