![]() |
HitLib 1.5.0
VEX V5 LED animation library for PROS
|
The handful of OS and hardware calls HitLib needs, kept apart from any one SDK so the library builds under PROS and VEXcode alike. More...
#include <cstdint>Classes | |
| class | hitlib::platform::Mutex |
| Non-recursive mutex, blocking take. More... | |
| class | hitlib::platform::AdiLed |
| A WS2812B strip on one ADI port, either the brain's own or an ADI expander's. More... | |
Namespaces | |
| namespace | hitlib |
| namespace | hitlib::platform |
Macros | |
| #define | HITLIB_PLATFORM_PROS |
| #define | HITLIB_PLATFORM_VEXCODE |
| #define | HITLIB_PLATFORM_HOST |
Functions | |
| uint32_t | hitlib::platform::millis () |
| Milliseconds since the program started. | |
| void | hitlib::platform::delay (uint32_t ms) |
Sleep the calling task for ms milliseconds. | |
| void | hitlib::platform::delayUntil (uint32_t &prevMs, uint32_t ms) |
Sleep until prevMs + ms, then advance prevMs by ms. | |
| void | hitlib::platform::startTask (void(*entry)(void *), void *arg, const char *name) |
Start a background task that runs entry(arg). | |
The handful of OS and hardware calls HitLib needs, kept apart from any one SDK so the library builds under PROS and VEXcode alike.
Nothing here includes a PROS or VEX header: each backend lives in its own source file (platform_pros.cpp, platform_vexcode.cpp) and only the one matching the project compiles to anything. The platform is detected from the headers on the include path; to force it, define one of these before building the library:
| Macro | Platform |
|---|---|
| HITLIB_PLATFORM_PROS=1 | PROS 4.x |
| HITLIB_PLATFORM_VEXCODE=1 | VEXcode V5, VEXcode Pro V5, VS Code VEX extension |
| HITLIB_PLATFORM_HOST=1 | A desktop build, for tests only. Never auto-detected. |
User code never needs to touch this header.
| #define HITLIB_PLATFORM_PROS |
| #define HITLIB_PLATFORM_VEXCODE |
| #define HITLIB_PLATFORM_HOST |