yy1717
2023-03-31 4bd08f0355b6b2cf3c027202d5ad301b4e182953
lib/src/main/cpp/mcu/ahp.cpp
@@ -36,7 +36,7 @@
        }
        case ID_GNSS_DATA: {
//            DEBUG("ID_GNSS_DATA %d", length);
            DEBUG("ID_GNSS_DATA %d", length);
            memcpy(RxBuf + RxBufLen, data, length);
            RxBufLen += length;
@@ -113,8 +113,9 @@
    pCls = nullptr;
}
static void AhpRun(void)
void InitAhp(void)
{
    // TODO
    static struct serial_config serialConfig;
    strcpy(serialConfig.name, "/dev/ttyCH341USB3");
@@ -124,17 +125,13 @@
    serialConfig.stop_bit = 1;
    serialConfig.flow_ctrl = 0;
    while (true) {
        std::thread t(UartThread, &serialConfig);
        t.join();
        std::this_thread::sleep_for(std::chrono::seconds(3));
    }
}
void InitAhp(void)
{
    // TODO
    std::thread(AhpRun).detach();
    std::thread([&] {
        while (true) {
            std::thread t(UartThread, &serialConfig);
            t.join();
            std::this_thread::sleep_for(std::chrono::seconds(3));
        }
    }).detach();
}
static void SendDfuFile(int fileLen, int sentLen, int blockLen, const uint8_t *data) {