Here is a piece of code. It is not clear what is being done in cycles. Not even the syntax itself is clear.
typedef struct { uint8_t dst; uint8_t regnum; uint8_t len; uint8_t *data; uint8_t checksum; } __attribute__((__packed__)) pkt_t; for (i = 0; i < 3; i++) pkt.checksum += ((uint8_t *)&pkt)[i]; for (i = 0; i < len; i++) pkt.checksum += ((uint8_t *)data)[i];