<commit_before>#ifndef TIMER_H
#define TIMER_H

#define PREV_DISTS 4

volatile uint16_t timer_1;  // 1ms resolution timer
volatile uint16_t timer_2;  // used for controlling solenoid time and green LED blinking
volatile uint16_t peer_timer;   // timer for transmitting to peer
volatile uint16_t sim_timer;    // timer for transmitting to sim
volatile uint16_t solenoid_on_time; // time duration in ms for solenoid to be activated for.
volatile uint8_t solenoid_on;       // bool for whether or not the solenoid is currently on.
volatile uint8_t currently_peering; // bool for whether or not the payload is peering.

void tim_init();

void solenoid_init();

void activate_solenoid(uint16_t on_time);

void deactivate_solenoid();

uint16_t control(int32_t alt, int32_t peer_alt, int32_t *prev_dists, int32_t *prev_delta_dists);

ISR(TIMER1_COMPA_vect);

#endif
<commit_msg>only save 3 previous dists for the average. taken every 5 seconds.<commit_after>#ifndef TIMER_H
#define TIMER_H

#define PREV_DISTS 3

volatile uint16_t timer_1;  // 1ms resolution timer
volatile uint16_t timer_2;  // used for controlling solenoid time and green LED blinking
volatile uint16_t peer_timer;   // timer for transmitting to peer
volatile uint16_t sim_timer;    // timer for transmitting to sim
volatile uint16_t solenoid_on_time; // time duration in ms for solenoid to be activated for.
volatile uint8_t solenoid_on;       // bool for whether or not the solenoid is currently on.
volatile uint8_t currently_peering; // bool for whether or not the payload is peering.

void tim_init();

void solenoid_init();

void activate_solenoid(uint16_t on_time);

void deactivate_solenoid();

uint16_t control(int32_t alt, int32_t peer_alt, int32_t *prev_dists, int32_t *prev_delta_dists);

ISR(TIMER1_COMPA_vect);

#endif

{'fraction_non_alphanumeric': 0.06128133704735376, 'fraction_numerical': 0.033426183844011144, 'mean_word_length': 4.907894736842105, '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': '2683344', 'n_tokens_mistral': 650, 'n_tokens_neox': 583, 'n_words': 209}