Search in sources :

Example 1 with VectorTable

use of net.sourceforge.usbdm.peripheralDatabase.VectorTable in project usbdm-eclipse-plugins by podonoghue.

the class DeviceInfo method generateVectorTable.

/**
 * Creates vector table information and add to variable map
 *
 * @param variableMap
 * @param devicePeripherals
 * @param monitor
 *
 * @throws Exception
 */
private void generateVectorTable(Map<String, String> variableMap, DevicePeripherals devicePeripherals, IProgressMonitor monitor) throws Exception {
    // Get description of all peripherals for this device
    SubMonitor progress = SubMonitor.convert(monitor, getPeripherals().size() * 100);
    progress.subTask("Modifying vector table");
    // Update vector table
    VectorTable vectorTable = devicePeripherals.getVectorTable();
    for (String peripheralName : getPeripherals().keySet()) {
        getPeripherals().get(peripheralName).modifyVectorTable(vectorTable);
        progress.worked(100);
    }
    // Add information to variable map
    variableMap.put(UsbdmConstants.C_VECTOR_TABLE_INCLUDES_KEY, vectorTable.getCIncludeFiles());
    variableMap.put(UsbdmConstants.C_VECTOR_TABLE_KEY, vectorTable.getCVectorTableEntries());
}
Also used : SubMonitor(org.eclipse.core.runtime.SubMonitor) VectorTable(net.sourceforge.usbdm.peripheralDatabase.VectorTable)

Example 2 with VectorTable

use of net.sourceforge.usbdm.peripheralDatabase.VectorTable in project usbdm-eclipse-plugins by podonoghue.

the class TestVectorTable method testVectorTable.

static void testVectorTable(String device) throws Exception {
    // Get description of all peripherals for device
    DevicePeripheralsFactory factory = new DevicePeripheralsFactory();
    DevicePeripherals devicePeripherals = factory.getDevicePeripherals(device);
    if (devicePeripherals == null) {
        // Return empty model
        System.err.println("Failed");
        return;
    }
    VectorTable vt = devicePeripherals.getVectorTable();
    String cVectorTable = vt.getCVectorTableEntries();
    System.err.print(cVectorTable);
}
Also used : DevicePeripherals(net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals) VectorTable(net.sourceforge.usbdm.peripheralDatabase.VectorTable) DevicePeripheralsFactory(net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)

Aggregations

VectorTable (net.sourceforge.usbdm.peripheralDatabase.VectorTable)2 DevicePeripherals (net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals)1 DevicePeripheralsFactory (net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)1 SubMonitor (org.eclipse.core.runtime.SubMonitor)1