Various fixes for SAMD (#510)

* Only serial GW should hold back on USB

* Fixing some examples on archs other than avr

* HwInit() is needed on samd, to init I2C
This commit is contained in:
Thomas Mørch
2016-07-16 10:01:28 +02:00
committed by Olivier
parent 54c79308e9
commit f0f2542df4
10 changed files with 352 additions and 361 deletions
+4 -4
View File
@@ -68,7 +68,7 @@ void hwReadConfigBlock(void* buf, void* adr, size_t length)
int offs = reinterpret_cast<int>(adr);
while (length-- > 0)
{
*dst++ = i2c_eeprom_read_byte(offs++);
*dst++ = i2c_eeprom_read_byte(offs++);
}
}
@@ -100,7 +100,7 @@ void hwWriteConfig(int adr, uint8_t value)
void hwInit() {
MY_SERIALDEVICE.begin(MY_BAUD_RATE);
#ifndef MY_GATEWAY_W5100
#if defined(MY_GATEWAY_SERIAL)
while (!MY_SERIALDEVICE) {}
#endif
Wire.begin();
@@ -142,12 +142,12 @@ uint16_t hwCPUVoltage() {
// TODO: Not supported!
return 0;
}
uint16_t hwCPUFrequency() {
// TODO: Not supported!
return 0;
}
uint16_t hwFreeMem() {
// TODO: Not supported!
return 0;