SOES implementation i.c.w. ET1100 (Beckhoff ASIC)
Dependencies: KL25Z_ClockControl MODSERIAL mbed
Fork of EtherCAT-XbusMaster by
Diff: soes.cpp
- Revision:
- 26:c7959f1fd09a
- Parent:
- 25:829af6f3429f
- Child:
- 27:93c0e4ae943e
diff -r 829af6f3429f -r c7959f1fd09a soes.cpp --- a/soes.cpp Sun Mar 08 21:15:47 2015 +0000 +++ b/soes.cpp Sun Mar 08 21:53:00 2015 +0000 @@ -96,8 +96,18 @@ switch (subindex) { case 0x01: - dummy8 = 0;//Eb.setting8;//Write value to EEPROM; eeprom_write_byte(&eedat.setting8, Wb.setting8); + { + uint32_t rates[] = {460800,230400,115200,76800,57600,38400,28800,19200,14400,9600}; + if(Eb.setting8 < (sizeof(rates)/sizeof(uint32_t)) ) + { + XbusSetBaudRate(Eb.setting8); + XbusReset(); + xbus_serial.baud(rates[Eb.setting8]); + XbusInitializeXbusMaster(); + + } break; + } case 0x02: dummy16 = 0;//Eb.setting16;//Write value to EEPROM; eeprom_write_word(&eedat.setting16, Wb.setting16); break;