/
Sangak
/
ardupilot
Обзор
Документация
Войти
/
Sangak
/
ardupilot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
libraries/AP_Scripting/examples/checksum_firmware.lua
27 строк
700 B
Peter Barker
AP_Scripting: add example which prints checksum of @SYS/flash.bin
23 июл 2025, 03:50
23 июл 2025, 03:50
ae48665
Код
Авторство
О чём код?
--[[ This script reads the firmware, calculates a checksum and emits a text message. It does this 10 seconds after boot. And any time millis() wraps. --]] local flash_file_path = "@SYS/flash.bin" function update() -- wait until we've been booted 10 seconds before sending: local now = millis() if now < 10000 then -- not time yet return update, 100 end local result = fs:crc32(flash_file_path) if result == nil then gcs:send_text(3, string.format("checksum_firmware error: checksumming failed")) else gcs:send_text(3, string.format("checksum_firmware: 0x%x", result:toint())) end return -- this script is one-shot end return update()