Main public entry point for the lsh-core library. More...
#include "lsh_user_macros.hpp"

Go to the source code of this file.
Functions | |
| void | lsh::core::setup () |
Initialize the runtime once from Arduino setup(). | |
| void | lsh::core::loop () |
Run one firmware iteration from Arduino loop(). | |
Main public entry point for the lsh-core library.
Copyright 2026 Jacopo Labardi
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| void lsh::core::loop | ( | ) |
Run one firmware iteration from Arduino loop().
Execute one controller loop iteration.
This function is the hot runtime path and must be called from Arduino loop() forever. It refreshes the cached time, scans local inputs, handles inbound bridge traffic, manages network-click timeouts and actuator auto-off timers, then publishes the latest local state back to the bridge when a refresh is pending and the receive grace period has elapsed.
< Previous cached loop timestamp; one 32-bit delta feeds every periodic gate.
< True when the bridge must receive a fresh actuator snapshot.
< Number of bridge payloads already dispatched in this loop iteration.
< Raw UART bytes already consumed in this loop iteration.
< Previous cached loop timestamp; one 32-bit delta feeds every periodic gate.
< True when the bridge must receive a fresh actuator snapshot.
< Number of bridge payloads already dispatched in this loop iteration.
< Raw UART bytes already consumed in this loop iteration.


| void lsh::core::setup | ( | ) |
Initialize the runtime once from Arduino setup().
Initialize the lsh-core runtime.
This entry point must be called exactly once from Arduino setup(). It initializes the optional debug serial, refreshes the cached loop time, starts the controller-to-bridge serial link, applies the user-defined topology, and then starts the bridge resynchronization handshake so the bridge must request fresh details and state before sending mutating commands.

