Exemple #1
0
Fichier : pci.c Projet : aosm/boot
_pci_slot_info_t *
PCI_Bus_Init(
    PCI_bus_info_t *info	/* pass in the PCI boot info struct */
)
{
    unsigned int maxBusNum = 0, maxDevNum = 0, useMethod = 0;
    _pci_bus_method_t method = NULL;
    _pci_slot_info_t *slot_array;
    unsigned nslots;

    maxBusNum = info->maxBusNum;
    if (info->BIOSPresent) {
	if (info->u_bus.s.configMethod1) {
	    useMethod=1;
	    maxDevNum=31;
	}
	else if (info->u_bus.s.configMethod2) {
	    useMethod=2;
	    maxDevNum=15;
	}
    }
    else {
	if (testMethod1()) {
	    useMethod=1;
	    maxDevNum=31;
	}
	else if (testMethod2()) {
	    useMethod=2;
	    maxDevNum=15;
	}
    }

    if (useMethod == 1)
	method = getMethod1;
    else if (useMethod == 2)
	method = getMethod2;
    else
	return NULL;

    nslots = scanBus(maxBusNum, maxDevNum, method, NULL);
    slot_array = (_pci_slot_info_t *)
	malloc(sizeof(_pci_slot_info_t) * nslots +1);
    (void)scanBus(maxBusNum, maxDevNum, method, slot_array);
    slot_array[nslots].pid = 0x00;
    slot_array[nslots].sid = 0x00;
    PCISlotInfo = slot_array;
    return slot_array;
}
void lcdSystemStarting()
{
	Wire.pins(2, 0);
	scanBus();
	if (lcdFound){
		lcd = new LiquidCrystal_I2C(lcdAddr, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
		lcd->begin(16, 2);
		lcd->backlight();

		lcd->createChar(1, icon_termometer);
		lcd->createChar(2, icon_water);
		lcd->createChar(3, celsius);

		lcd->setCursor(0,0);
		lcd->print("System starting");
		lcd->setCursor(0,1);
		lcd->print("Please wait...");
	}
}