12 using namespace std::chrono;
19 std::cout <<
"IMU type: " << imuType <<
" firmware version: " << imuFirmwareVersion
20 <<
" embedded firmware version: " << embeddedIMUFirmwareVersion << std::endl;
22 std::cout <<
"Warning! Flashing IMU firmware can potentially soft brick your device and should be done with caution." << std::endl;
23 std::cout <<
"Do not unplug your device while the IMU firmware is flashing." << std::endl;
24 std::cout <<
"Type 'y' and press enter to proceed, otherwise exits: ";
26 if(std::cin.
get() !=
'y') {
27 std::cout <<
"Prompt declined, exiting..." << std::endl;
33 std::cout <<
"Couldn't start IMU firmware update" << std::endl;
38 bool fwUpdateFinished;
39 unsigned int percentage;
41 std::cout <<
"IMU FW update status: " << std::setprecision(1) << percentage << std::endl;
42 if(fwUpdateFinished) {
43 if(percentage == 100) {
44 std::cout <<
"Firmware update successful!" << std::endl;
46 std::cout <<
"Firmware update failed!" << std::endl;
50 std::this_thread::sleep_for(1s);