コード例 #1
0
ファイル: startup.c プロジェクト: A-Paul/RIOT
/**
 * @brief Initialize the CPU, the board and the peripherals
 *
 * This function is called by ESP8266 SDK when all system initializations
 * has been finished.
 */
void system_init(void)
{
    LOG_INFO("\nStarting ESP8266 CPU with ID: %08x", system_get_chip_id());
    LOG_INFO("\nSDK Version %s\n\n", system_get_sdk_version());

    /* avoid reconnection all the time */
    wifi_station_disconnect();

    /* set exception handlers */
    init_exceptions ();

    /* init random number generator */
    srand(hwrand());

    /* init flash drive */
    extern void flash_drive_init (void);
    flash_drive_init();

    /* trigger static peripheral initialization */
    periph_init();

    /* trigger board initialization */
    board_init();

    /* print the board config */
    board_print_config();
}
コード例 #2
0
ファイル: diskio.c プロジェクト: justinsider/psshit
DSTATUS disk_initialize (
	BYTE pdrv				/* Physical drive nmuber (0..) */
)
{
	uint8_t result;

	if(pdrv == 0)
	{
		result = flash_drive_init();
		if(result == FLASH_DRIVE_INIT_ERR_LIBUSB_OPEN_DEVICE)
		{
			return STA_NODISK;
		}
		else if(result>0)
		{
			return STA_NOINIT;
		}

		return STA_INIT_SUCCESS;
	}
	return STA_NOINIT;
}