struct { // Communication structures
bool rf; // Receive flag, indicating if data has been received uint8_t tb[50]; // Transmit buffer (stores data to be transmitted) uint8_t rb[50]; // Receive buffer (stores received data) uint8_t tc; // Transmit count (tracks the number of bytes to be sent) uint8_t rc; // Receive count (tracks the number of bytes received) uint8_t rt; // Receive timeout (20ms * 5 = 100ms, used for handling communication timeouts) uint8_t fn; // Field name (used for identifying communication fields) uint8_t hi, lo; // Used for Modbus communication (high and low byte storage) } cm0; //----------------------- hw_timer_t *timer1 = NULL; // 25ms Timer instance for periodic tasks struct { // Timer-related variables uint8_t fg; // Flag to indicate timer-related events byte tc; // Timer counter for general use byte t100ms; // Counter for 100ms intervals byte t500ms; // Counter for 500ms intervals byte sec; // Second counter } tim; //----------------------- struct { uint16_t reg[50]; // Array for storing data (e.g., sensor values, Modbus registers) } ccu;참고!!
댓글 없음:
댓글 쓰기