<commit_before>/**
 * SIGMusic Lights 2015
 * Arduino receiver firmware
 */

#include "Arduino.h"
#include <RF24.h>
#include <SPI.h>
#include <EEPROM.h>


// RGB pins
// Note: pins 5 and 6 use the fast, inaccurate PWM timer. If this becomes
// an issue, look into software PWM implementations.
#define RED_PIN                 3
#define GREEN_PIN               5
#define BLUE_PIN                6

// Radio pins
#define CE_PIN                  9 // Radio chip enable pin
#define CSN_PIN                 10 // Radio chip select pin

// Wireless protocol
#define HASH(a)                 ((a) ^ 73) // Simple 1:1 single byte hash to minimize repeating bit patterns in address
#define RF_ADDRESS(endpoint)    (0x5349474D00LL | HASH(endpoint & 0xFF)) // Generates a 40-bit nRF address
#define HEADER                  7446 // Must prefix every message
#define BASE_STATION_ID         0x00 // The endpoint ID of the base station
#define MULTICAST_ID            0xFF // The endpoint ID that all lights listen to

#define ENDPOINT_PIPE           1 // The pipe for messages for this endpoint
#define MULTICAST_PIPE          2 // The pipe for multicast messages

#define CHANNEL                 80 // Channel center frequency = 2.4005 GHz + (Channel# * 1 MHz)
#define NUM_RETRIES             5

enum COMMANDS {
    CMD_SET_RGB       = 0x10,
    CMD_PING          = 0x20,
    CMD_PING_RESPONSE = 0x21,
};
<commit_msg>Now using big-endian<commit_after>/**
 * SIGMusic Lights 2015
 * Arduino receiver firmware
 */

#include "Arduino.h"
#include <RF24.h>
#include <SPI.h>
#include <EEPROM.h>


// RGB pins
// Note: pins 5 and 6 use the fast, inaccurate PWM timer. If this becomes
// an issue, look into software PWM implementations.
#define RED_PIN                 3
#define GREEN_PIN               5
#define BLUE_PIN                6

// Radio pins
#define CE_PIN                  9 // Radio chip enable pin
#define CSN_PIN                 10 // Radio chip select pin

// Network-host endianness conversions
#define htons(n) (((((uint16_t)(n) & 0xFF)) << 8) | (((uint16_t)(n) & 0xFF00) >> 8))
#define ntohs(n) (((((uint16_t)(n) & 0xFF)) << 8) | (((uint16_t)(n) & 0xFF00) >> 8))

// Wireless protocol
#define HASH(a)                 ((a) ^ 73) // Simple 1:1 single byte hash to minimize repeating bit patterns in address
#define RF_ADDRESS(endpoint)    (0x5349474D00LL | HASH(endpoint & 0xFF)) // Generates a 40-bit nRF address
#define HEADER                  htons(7446) // Must prefix every message
#define BASE_STATION_ID         0x00 // The endpoint ID of the base station
#define MULTICAST_ID            0xFF // The endpoint ID that all lights listen to

#define ENDPOINT_PIPE           1 // The pipe for messages for this endpoint
#define MULTICAST_PIPE          2 // The pipe for multicast messages

#define CHANNEL                 80 // Channel center frequency = 2.4005 GHz + (Channel# * 1 MHz)
#define NUM_RETRIES             5

enum COMMANDS {
    CMD_SET_RGB       = 0x10,
    CMD_PING          = 0x20,
    CMD_PING_RESPONSE = 0x21,
};

{'fraction_non_alphanumeric': 0.09300791556728233, 'fraction_numerical': 0.04551451187335093, 'mean_word_length': 2.261290322580645, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2719655', 'n_tokens_mistral': 1062, 'n_tokens_neox': 912, 'n_words': 339}