micros-to-u32

nazarijtipusak080/shift-4-bytes/micros-to-u32

Converts micros to a 32-bit unsigned integer presented as 4 bytes.
micros-to-u32
@/micros-to-u32
Converts micros to a 32-bit unsigned integer presented as 4 bytes.
INxod/core/micros
micros-to-u32
IN
B3
B2
B1
B0
B0byte
Least significant byte
B1byte
B2byte
B3byte
Most significant byte
To use the node in your project you should have the nazarijtipusak080/shift-4-bytes library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        uint32_t val = getValue<input_IN>(ctx);
        uint8_t b3 = (val >> 24);
        uint8_t b2 = (val >> 16);
        uint8_t b1 = (val >> 8);
        uint8_t b0 = val;
        emitValue<output_B0>(ctx, b0);
        emitValue<output_B1>(ctx, b1);
        emitValue<output_B2>(ctx, b2);
        emitValue<output_B3>(ctx, b3);
    }
}