1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef WAITFORRESTART_SOURCE
- #define WAITFORRESTART_SOURCE
- #include "../plc/plc.h"
- #include "../tools/error.h"
- #include "../tools/flags.h"
- signed WaitForRestart (struct plc * plc)
- {
- if (_allclr (plc->flags, PLC_QUICK_FLASH))
- {
- char firmware [PLC_VERSION_STRING];
- unsigned timer = plc->timer;
- if (WaitForReset (plc))
- {
- error ((plc->flags & PLC_BAILOUT), 0, "Device did not Reset");
- return (-1);
- }
- plc->timer = PLC_FLASH;
- if (WaitForStart (plc, firmware, sizeof (firmware)))
- {
- error ((plc->flags & PLC_BAILOUT), 0, "Device did not Start");
- plc->timer = timer;
- return (-1);
- }
- plc->timer = timer;
- }
- return (0);
- }
- #endif
|