<commit_before>
#ifndef CONSTANTS_H
#define CONSTANTS_H

//ROS Diagnostics states
#define STATE_OK 0
#define STATE_WARN 1
#define STATE_ERROR 2
#define STATE_STALE 3

//Status structure
typedef struct Status {
    const char* str;
    int16_t code;
    uint16_t blink_code;
} Status;

//Defined statuses
Status STATUS_ENABLED = {"Enabled", STATE_OK, /*10_1010_1010*/0x2AA}; 
Status STATUS_DISABLED = {"Disabled", STATE_OK, /*11_1110_0000*/0x3E0};
Status STATUS_NO_CONTROL_DATA = {"No data", STATE_WARN, /*10_1010_0000*/0x2A0};
Status STATUS_NO_CONNECTION = {"No connection", STATE_ERROR, /*10_1000_0000*/0x280};

//Status LED (pin sources LED current)
#define P_LED_STATUS 12

//SERVO MODE
//Motor control pins (for servo PWM)
#define P_MOTOR_1 25 //MCU Pin: PB5; MCU Output Compare: OCR1A; Silkscreen: Pod Motor Control - 1 / J28; Schematic: POD_MOTOR2
#define P_MOTOR_2 16 //MCU Pin: PC6; MCU Output Compare: OCR3A; Silkscreen: LED Board Control - 6 / J32; Schematic: LED3
#define P_MOTOR_3 27 //MCU Pin: PB7; MCU Output Compare: OCR1C; Silkscreen: Pod Motor Control - 2 / J31; Schematic: POD_MOTOR4
#define P_MOTOR_4 26 //MCU Pin: PB6; MCU Output Compare: OCR1B; Silkscreen: Pod Motor Control - 4 / J30; Schematic: POD_MOTOR3
//External LED pins (for analogWrite)
#define P_EXT_LED_1 14 //MCU Pin: PC4; MCU Output Compare: OCR3C; Silkscreen: LED Board Control - 4 / J26; Schematic: LED1
#define P_EXT_LED_2 15 //MCU Pin: PC5; MCU Output Compare: OCR3B; Silkscreen: LED Board Control - 5 / J29; Schematic: LED2
#define P_EXT_LED_3 24 //MCU Pin: PB4; MCU Output Compare: OCR2A; Silkscreen: Pod Motor Control - 3 / J27; Schematic: POD_MOTOR1

//SERIAL MODE
#define P_FRONT_TX 25
#define P_FRONT_RX 16
#define P_BACK_TX 27
#define P_BACK_RX 26
#define MAKE_MOTOR_1_BYTE(power) (((int16_t)power-1500)+64)
#define MAKE_MOTOR_2_BYTE(power) (((int16_t)power-1500)+192)
#define MAKE_MOTOR_3_BYTE(power) (((int16_t)power-1500)+64)
#define MAKE_MOTOR_4_BYTE(power) (((int16_t)power-1500)+192)

//TIMER MODE
//16 bit timer top value
#define TIMER_TOP 10000
//Motor control output compare registers
#define REG_MOTOR_1 OCR1A
#define REG_MOTOR_2 OCR3A
#define REG_MOTOR_3 OCR1C<commit_msg>Swapped front motor mappings<commit_after>
#ifndef CONSTANTS_H
#define CONSTANTS_H

//ROS Diagnostics states
#define STATE_OK 0
#define STATE_WARN 1
#define STATE_ERROR 2
#define STATE_STALE 3

//Status structure
typedef struct Status {
    const char* str;
    int16_t code;
    uint16_t blink_code;
} Status;

//Defined statuses
Status STATUS_ENABLED = {"Enabled", STATE_OK, /*10_1010_1010*/0x2AA}; 
Status STATUS_DISABLED = {"Disabled", STATE_OK, /*11_1110_0000*/0x3E0};
Status STATUS_NO_CONTROL_DATA = {"No data", STATE_WARN, /*10_1010_0000*/0x2A0};
Status STATUS_NO_CONNECTION = {"No connection", STATE_ERROR, /*10_1000_0000*/0x280};

//Status LED (pin sources LED current)
#define P_LED_STATUS 12

//SERVO MODE
//Motor control pins (for servo PWM)
#define P_MOTOR_1 25 //MCU Pin: PB5; MCU Output Compare: OCR1A; Silkscreen: Pod Motor Control - 1 / J28; Schematic: POD_MOTOR2
#define P_MOTOR_2 16 //MCU Pin: PC6; MCU Output Compare: OCR3A; Silkscreen: LED Board Control - 6 / J32; Schematic: LED3
#define P_MOTOR_3 27 //MCU Pin: PB7; MCU Output Compare: OCR1C; Silkscreen: Pod Motor Control - 2 / J31; Schematic: POD_MOTOR4
#define P_MOTOR_4 26 //MCU Pin: PB6; MCU Output Compare: OCR1B; Silkscreen: Pod Motor Control - 4 / J30; Schematic: POD_MOTOR3
//External LED pins (for analogWrite)
#define P_EXT_LED_1 14 //MCU Pin: PC4; MCU Output Compare: OCR3C; Silkscreen: LED Board Control - 4 / J26; Schematic: LED1
#define P_EXT_LED_2 15 //MCU Pin: PC5; MCU Output Compare: OCR3B; Silkscreen: LED Board Control - 5 / J29; Schematic: LED2
#define P_EXT_LED_3 24 //MCU Pin: PB4; MCU Output Compare: OCR2A; Silkscreen: Pod Motor Control - 3 / J27; Schematic: POD_MOTOR1

//SERIAL MODE
#define P_FRONT_TX 25
#define P_FRONT_RX 16
#define P_BACK_TX 27
#define P_BACK_RX 26
#define MAKE_MOTOR_1_BYTE(power) (((int16_t)power-1500)+192)
#define MAKE_MOTOR_2_BYTE(power) (((int16_t)power-1500)+64)
#define MAKE_MOTOR_3_BYTE(power) (((int16_t)power-1500)+64)
#define MAKE_MOTOR_4_BYTE(power) (((int16_t)power-1500)+192)

//TIMER MODE
//16 bit timer top value
#define TIMER_TOP 10000
//Motor control output compare registers
#define REG_MOTOR_1 OCR1A
#define REG_MOTOR_2 OCR3A
#define REG_MOTOR_3 OCR1C
{'fraction_non_alphanumeric': 0.10478151452756806, 'fraction_numerical': 0.08419126058110273, 'mean_word_length': 5.106145251396648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2888641', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1698, 'n_words': 512}