1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #ifndef FLASHSOFTLOADER_SOURCE
- #define FLASHSOFTLOADER_SOURCE
- #include "../plc/plc.h"
- signed FlashSoftloader (struct plc * plc, uint32_t options)
- {
- struct vs_module_spec vs_module_spec =
- {
- PLC_MODULEID_SOFTLOADER,
- 0,
- 0,
- 0
- };
- ModuleSpec (& plc->SFT, & vs_module_spec);
- if (ModuleSession (plc, 1, & vs_module_spec))
- {
- return (-1);
- }
- if (ModuleWrite (plc, & plc->SFT, 0, & vs_module_spec))
- {
- return (-1);
- }
- if (ModuleCommit (plc, options))
- {
- return (-1);
- }
- return (0);
- }
- #endif
|