ADD library update-client
This commit is contained in:
21
main.cpp
21
main.cpp
@@ -8,7 +8,9 @@
|
||||
#include "mbed.h" // NOLINT
|
||||
#include "mbed_trace.h"
|
||||
// #include "static_scheduling/bike_system.hpp"
|
||||
#include "FlashIAPBlockDevice.h"
|
||||
#include "static_scheduling_with_event/bike_system.hpp"
|
||||
#include "update-client/usb_serial_uc.hpp"
|
||||
|
||||
#if defined(MBED_CONF_MBED_TRACE_ENABLE)
|
||||
#define TRACE_GROUP "MAIN"
|
||||
@@ -19,12 +21,25 @@ int main() {
|
||||
mbed_trace_init();
|
||||
#endif
|
||||
|
||||
// static_scheduling::BikeSystem bikeSystem;
|
||||
// bikeSystem.start();
|
||||
// bikeSystem.startWithEventQueue();
|
||||
tr_info("Start");
|
||||
|
||||
FlashIAPBlockDevice flashIAPBlockDevice(MBED_ROM_START, MBED_ROM_SIZE);
|
||||
update_client::USBSerialUC usbSerialUpdateClient(flashIAPBlockDevice);
|
||||
update_client::UCErrorCode rc = usbSerialUpdateClient.start();
|
||||
if (rc != update_client::UCErrorCode::UC_ERR_NONE) {
|
||||
tr_error("Cannot initialize update client: %d", rc);
|
||||
} else {
|
||||
tr_info("Update client started");
|
||||
}
|
||||
|
||||
// static_scheduling::BikeSystem bikeSystem;
|
||||
static_scheduling_with_event::BikeSystem bikeSystem;
|
||||
|
||||
tr_debug("Starting Bike System");
|
||||
// bikeSystem.startWithEventQueue();
|
||||
bikeSystem.start();
|
||||
while (true) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MBED_TEST_MODE
|
||||
|
||||
Reference in New Issue
Block a user