<commit_before>#ifndef message_structs_h
#define message_structs_h

#include <stdint.h>
#include "constants.h"

////////////////////// Message Packet Structures /////////////////////////////////
// All
typedef struct __attribute__((__packed__)){
  uint16_t host_revision;
  uint8_t  reserved[6];
} msg_initialize_t;

//typedef struct __attribute__((__packed__)){
//  ;  // no fields in message
//} msg_status_t;

//typedef struct __attribute__((__packed__)){
//  ;  // no fields in message
//} msg_home_t;

typedef struct { // Assume we don't have to pad this on 32-bit systems
  int32_t length;
  uint32_t total_length;
  uint32_t initial_rate;
  uint32_t nominal_rate;
  uint32_t final_rate;
  uint32_t acceleration;
  uint32_t stop_accelerating;
  uint32_t start_decelerating;
} msg_queue_move_t;

typedef struct __attribute__((__packed__)){
  uint8_t param_id;
} msg_get_param_t;

typedef struct __attribute__((__packed__)){
  uint32_t param_value;
  uint8_t param_id;
} msg_set_param_t;


///////////////////////// Response Packet Structures /////////////////////////////////
// All response packets begin with a single byte response character, not included in the
// structs below because it would mess with efficient packing on 32-bit microcontrollers.

typedef struct __attribute__((__packed__)){
  uint16_t slave_hw_ver;
  uint16_t slave_fw_ver;
  uint16_t queue_depth;
} rsp_initialize_t;

typedef struct __attribute__((__packed__)){
  int32_t location;
  uint32_t sync_error;
  imc_axis_error status;
  uint16_t queued_moves;
} rsp_status_t;

typedef struct __attribute__((__packed__)){
  int32_t old_position;
} rsp_home_t;

//typedef struct __attribute__ ((__packed__)){
//} rsp_queue_move_t;

typedef struct __attribute__((__packed__)){
  uint32_t value;
} rsp_get_param_t;

//typedef struct __attribute__((__packed__)){
//} rsp_set_param_t;<commit_msg>Modified parameter order in message_structs/rsp_status_t to maintain byte alighment.<commit_after>#ifndef message_structs_h
#define message_structs_h

#include <stdint.h>
#include "constants.h"

////////////////////// Message Packet Structures /////////////////////////////////
// All
typedef struct __attribute__((__packed__)){
  uint16_t host_revision;
  uint8_t  reserved[6];
} msg_initialize_t;

//typedef struct __attribute__((__packed__)){
//  ;  // no fields in message
//} msg_status_t;

//typedef struct __attribute__((__packed__)){
//  ;  // no fields in message
//} msg_home_t;

typedef struct { // Assume we don't have to pad this on 32-bit systems
  int32_t length;
  uint32_t total_length;
  uint32_t initial_rate;
  uint32_t nominal_rate;
  uint32_t final_rate;
  uint32_t acceleration;
  uint32_t stop_accelerating;
  uint32_t start_decelerating;
} msg_queue_move_t;

typedef struct __attribute__((__packed__)){
  uint8_t param_id;
} msg_get_param_t;

typedef struct __attribute__((__packed__)){
  uint32_t param_value;
  uint8_t param_id;
} msg_set_param_t;


///////////////////////// Response Packet Structures /////////////////////////////////
// All response packets begin with a single byte response character, not included in the
// structs below because it would mess with efficient packing on 32-bit microcontrollers.

typedef struct __attribute__((__packed__)){
  uint16_t slave_hw_ver;
  uint16_t slave_fw_ver;
  uint16_t queue_depth;
} rsp_initialize_t;

typedef struct __attribute__((__packed__)){
  int32_t location;
  uint32_t sync_error;
  uint16_t queued_moves;
  imc_axis_error status;
} rsp_status_t;

typedef struct __attribute__((__packed__)){
  int32_t old_position;
} rsp_home_t;

//typedef struct __attribute__ ((__packed__)){
//} rsp_queue_move_t;

typedef struct __attribute__((__packed__)){
  uint32_t value;
} rsp_get_param_t;

//typedef struct __attribute__((__packed__)){
//} rsp_set_param_t;
{'fraction_non_alphanumeric': 0.14191852825229961, 'fraction_numerical': 0.023127463863337715, 'mean_word_length': 3.799495586380832, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2103041', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1253, 'n_words': 309}