rogerclarkmelbourne / Arduino_STM32

Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards
Other
2.52k stars 1.26k forks source link

no support serialEvent #815

Closed chaohuazhu closed 3 years ago

chaohuazhu commented 4 years ago

when support in main.c

int main(void)
{
    init();

    initVariant();

#if defined(USBCON)
    USBDevice.attach();
#endif

    setup();

    for (;;) {
        loop();
        if (serialEventRun) serialEventRun();
    }

    return 0;
}

when no support in main.c

int main(void) {
    setup();

    while (1) {
        loop();
    }
    return 0;
}
chaohuazhu commented 4 years ago

or its fast enough to let it be, 72Mhz

stevstrong commented 3 years ago

The serialEvent would be doable, but I wonder whether there is a real demand to implement that.

rogerclarkmelbourne commented 3 years ago

Unless things have changed recently...

The SerialEvent is not actually coded as a real event in the underlying core code.

The hidden main loop simply checks for data in the Serial buffer, hence most people just implement this in their own code

rogerclarkmelbourne commented 3 years ago

I'm going to close this thread, because the OP posted over 6 months ago, and didn't respond to the reply from @stevstrong