BikeComputer/main.cpp

46 lines
1.2 KiB
C++
Raw Normal View History

2024-10-20 15:02:14 +02:00
/* mbed Microcontroller Library
* Copyright (c) 2019 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*/
#if !MBED_TEST_MODE
#include "mbed.h" // NOLINT
2024-11-17 14:20:38 +01:00
#include "mbed_trace.h"
2024-12-18 10:32:03 +01:00
// #include "static_scheduling/bike_system.hpp"
2025-01-04 15:31:25 +01:00
#include "FlashIAPBlockDevice.h"
2024-11-17 23:09:00 +01:00
#include "static_scheduling_with_event/bike_system.hpp"
2025-01-04 15:31:25 +01:00
#include "update-client/usb_serial_uc.hpp"
2024-10-20 15:02:14 +02:00
2024-11-17 23:09:00 +01:00
#if defined(MBED_CONF_MBED_TRACE_ENABLE)
2024-11-17 14:20:38 +01:00
#define TRACE_GROUP "MAIN"
2024-11-17 23:09:00 +01:00
#endif // MBED_CONF_MBED_TRACE_ENAB
2024-11-17 14:20:38 +01:00
2024-10-20 15:02:14 +02:00
int main() {
2024-11-17 23:09:00 +01:00
#if defined(MBED_CONF_MBED_TRACE_ENABLE)
2024-11-17 14:20:38 +01:00
mbed_trace_init();
2024-11-17 23:09:00 +01:00
#endif
2024-11-18 09:14:00 +01:00
2025-01-04 15:31:25 +01:00
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");
}
2024-11-18 09:14:00 +01:00
2025-01-04 15:31:25 +01:00
// static_scheduling::BikeSystem bikeSystem;
2024-11-17 23:09:00 +01:00
static_scheduling_with_event::BikeSystem bikeSystem;
2025-01-04 15:31:25 +01:00
tr_debug("Starting Bike System");
// bikeSystem.startWithEventQueue();
2024-11-18 09:14:00 +01:00
bikeSystem.start();
2025-01-04 15:31:25 +01:00
while (true) {
}
2024-10-20 15:02:14 +02:00
}
#endif // MBED_TEST_MODE