<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ESP-FlexyStepper-master/src/ESP_FlexyStepper.h<|end_filename|>

//      ******************************************************************
//      *                                                                *
//      *                    Header file for ESP-FlexyStepper            *
//      *                                                                *
//      *            <NAME>                     4.6.2020            *
//      *       based on the concept of FlexyStepper by <NAME>      *
//      *                                                                *
//      ******************************************************************

// MIT License
//
// Copyright (c) 2020 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

// This library is based on the works of Stan Reifel in his FlexyStepper library:
// https://github.com/Stan-Reifel/FlexyStepper

#ifndef ESP_FlexyStepper_h
#define ESP_FlexyStepper_h

#ifdef ESP32
//
//#elif defined(ESP8266)
//
#else
#error Platform not supported, only ESP32 modules are currently supported
#endif


#include <Arduino.h>
#include <stdlib.h>

typedef void (*callbackFunction)(void);
typedef void (*positionCallbackFunction)(long);

class ESP_FlexyStepper
{
public:
  ESP_FlexyStepper();
  ~ESP_FlexyStepper();
  //service functions
  void startAsService(void);
  void stopService(void);
  bool isStartedAsService(void);

  //IO setup and helper / debugging functions
  void connectToPins(byte stepPinNumber, byte directionPinNumber=255);
  void setBrakePin(byte brakePin, byte activeState = ESP_FlexyStepper::ACTIVE_HIGH);
  long getTaskStackHighWaterMark(void);
  void clearLimitSwitchActive(void);
  bool motionComplete();
  int getDirectionOfMotion(void);
  bool isMovingTowardsHome(void);
  void emergencyStop(bool holdUntilReleased = false);
  void releaseEmergencyStop(void);
  void activateBrake(void);
  void deactivateBrake(void);
  bool isBakeActive(void);
  //the central function to calculate the next movment step signal
  bool processMovement(void);

  //register function for callbacks
  void registerHomeReachedCallback(callbackFunction homeReachedCallbackFunction);
  void registerLimitReachedCallback(callbackFunction limitSwitchTriggerdCallbackFunction);
  void registerTargetPositionReachedCallback(positionCallbackFunction targetPositionReachedCallbackFunction);
  void registerEmergencyStopTriggeredCallback(callbackFunction emergencyStopTriggerdCallbackFunction);
  void registerEmergencyStopReleasedCallback(callbackFunction emergencyStopReleasedCallbackFunction);

  //configuration functions
  void setStepsPerMillimeter(float motorStepPerMillimeter);
  void setStepsPerRevolution(float motorStepPerRevolution);
  void setSpeedInStepsPerSecond(float speedInStepsPerSecond);
  void setSpeedInMillimetersPerSecond(float speedInMillimetersPerSecond);
  void setSpeedInRevolutionsPerSecond(float speedInRevolutionsPerSecond);
  void setAccelerationInMillimetersPerSecondPerSecond(float accelerationInMillimetersPerSecondPerSecond);
  void setAccelerationInRevolutionsPerSecondPerSecond(float accelerationInRevolutionsPerSecondPerSecond);
  void setDecelerationInMillimetersPerSecondPerSecond(float decelerationInMillimetersPerSecondPerSecond);
  void setDecelerationInRevolutionsPerSecondPerSecond(float decelerationInRevolutionsPerSecondPerSecond);
  void setAccelerationInStepsPerSecondPerSecond(float accelerationInStepsPerSecondPerSecond);
  void setDecelerationInStepsPerSecondPerSecond(float decelerationInStepsPerSecondPerSecond);
  void setDirectionToHome(signed char directionTowardHome);
  void setLimitSwitchActive(byte limitSwitchType);

  void setBrakeEngageDelayMs(unsigned long);
  void setBrakeReleaseDelayMs(signed long);

  float getCurrentVelocityInStepsPerSecond();
  float getCurrentVelocityInRevolutionsPerSecond();
  float getCurrentVelocityInMillimetersPerSecond(void);

  //positioning functions
  void setCurrentPositionInSteps(long currentPositionInSteps);
  void setCurrentPositionInMillimeters(float currentPositionInMillimeters);
  void setCurrentPositionInRevolutions(float currentPositionInRevolutions);

  long getCurrentPositionInSteps();
  float getCurrentPositionInRevolutions();
  float getCurrentPositionInMillimeters();

  void startJogging(signed char direction);
  void stopJogging();
  void goToLimitAndSetAsHome(callbackFunction callbackFunctionForHome = NULL);
  void goToLimit(signed char direction, callbackFunction callbackFunctionForLimit = NULL);
  

  void setCurrentPositionAsHomeAndStop(void);
  void setTargetPositionToStop();
  long getDistanceToTargetSigned(void);

  void setTargetPositionInSteps(long absolutePositionToMoveToInSteps);
  void setTargetPositionInMillimeters(float absolutePositionToMoveToInMillimeters);
  void setTargetPositionInRevolutions(float absolutePositionToMoveToInRevolutions);
  void setTargetPositionRelativeInSteps(long distanceToMoveInSteps);
  void setTargetPositionRelativeInMillimeters(float distanceToMoveInMillimeters);
  void setTargetPositionRelativeInRevolutions(float distanceToMoveInRevolutions);

  long getTargetPositionInSteps();
  float getTargetPositionInMillimeters();
  float getTargetPositionInRevolutions();

  //blocking function calls
  void moveToPositionInSteps(long absolutePositionToMoveToInSteps);
  void moveToPositionInMillimeters(float absolutePositionToMoveToInMillimeters);
  void moveToPositionInRevolutions(float absolutePositionToMoveToInRevolutions);
  void moveRelativeInSteps(long distanceToMoveInSteps);
  void moveRelativeInMillimeters(float distanceToMoveInMillimeters);
  void moveRelativeInRevolutions(float distanceToMoveInRevolutions);

  bool moveToHomeInSteps(signed char directionTowardHome, float speedInStepsPerSecond, long maxDistanceToMoveInSteps, int homeSwitchPin);
  bool moveToHomeInMillimeters(signed char directionTowardHome, float speedInMillimetersPerSecond, long maxDistanceToMoveInMillimeters, int homeLimitSwitchPin);
  bool moveToHomeInRevolutions(signed char directionTowardHome, float speedInRevolutionsPerSecond, long maxDistanceToMoveInRevolutions, int homeLimitSwitchPin);

  static const byte LIMIT_SWITCH_BEGIN = -1;
  static const byte LIMIT_SWITCH_END = 1;
  static const byte LIMIT_SWITCH_COMBINED_BEGIN_AND_END = 2;
  static const byte ACTIVE_HIGH = 1;
  static const byte ACTIVE_LOW = 2;

private:
  callbackFunction _homeReachedCallback = NULL;
  callbackFunction _limitTriggeredCallback = NULL;
  callbackFunction _emergencyStopTriggeredCallback = NULL;
  callbackFunction _emergencyStopReleasedCallback = NULL;
  positionCallbackFunction _targetPositionReachedCallback = NULL;
  callbackFunction _callbackFunctionForGoToLimit = NULL;

  static void taskRunner(void *parameter);

  void DeterminePeriodOfNextStep();
  void triggerBrakeIfNeededOrSetTimeout(void);

  byte stepPin;
  byte brakePin = -1;
  byte brakePinActiveState = ACTIVE_HIGH;
  unsigned long _brakeEngageDelayMs = 0;
  signed long _brakeReleaseDelayMs = -1;
  unsigned long _timeToEngangeBrake = LONG_MAX;
  unsigned long _timeToReleaseBrake = LONG_MAX;
  bool _isBrakeConfigured = false;
  bool _hasMovementOccuredSinceLastBrakeRelease = true;

  byte directionPin;
  bool _isBrakeActive = false;
  float stepsPerMillimeter;
  float stepsPerRevolution;
  int directionOfMotion;
  long currentPosition_InSteps;
  long targetPosition_InSteps;
  float desiredSpeed_InStepsPerSecond;
  float desiredPeriod_InUSPerStep;
  float acceleration_InStepsPerSecondPerSecond;
  float acceleration_InStepsPerUSPerUS;
  float deceleration_InStepsPerSecondPerSecond;
  float deceleration_InStepsPerUSPerUS;
  float periodOfSlowestStep_InUS;
  float minimumPeriodForAStoppedMotion;
  float nextStepPeriod_InUS;
  unsigned long lastStepTime_InUS;
  float currentStepPeriod_InUS;
  bool emergencyStopActive;
  bool holdEmergencyStopUntilExplicitRelease;
  signed char directionTowardsHome;
  signed char lastStepDirectionBeforeLimitSwitchTrigger;
  //true if the current stepper positon equals the homing position
  bool isCurrentlyHomed;
  bool isOnWayToHome = false;
  bool isOnWayToLimit = false;
  bool firstProcessingAfterTargetReached = true;
  signed char activeLimitSwitch;
  bool limitSwitchCheckPeformed;
  // 0 if the the stepper is allowed to move in both directions (e.g. no limit or homing switch triggered), otherwise indicated which direction is currently not allowed for further movement
  signed char disallowedDirection;

  TaskHandle_t xHandle = NULL;
};

// ------------------------------------ End ---------------------------------
#endif


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/Encoder/library.json<|end_filename|>
{
  "name": "Encoder",
  "keywords": "encoder, signal, pulse",
  "description": "Encoder counts pulses from quadrature encoded signals, which are commonly available from rotary knobs, motor or shaft sensors and other position sensors",
  "repository":
  {
    "type": "git",
    "url": "https://github.com/PaulStoffregen/Encoder.git"
  },
  "frameworks": "arduino",
  "platforms":
  [
    "atmelavr",
    "teensy"
  ]
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/FailingBuilds/assign_char.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>

// See issue #1498

int main() {
  DynamicJsonDocument doc(1024);
  doc["dummy"] = 'A';
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Strings/String.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Strings/ConstRamStringAdapter.hpp>
#include <ArduinoJson/Strings/IsString.hpp>
#include <ArduinoJson/Strings/StoragePolicy.hpp>

namespace ARDUINOJSON_NAMESPACE {

class String {
 public:
  String() : _data(0), _isStatic(true) {}
  String(const char* data, bool isStaticData = true)
      : _data(data), _isStatic(isStaticData) {}

  const char* c_str() const {
    return _data;
  }

  bool isNull() const {
    return !_data;
  }

  bool isStatic() const {
    return _isStatic;
  }

  friend bool operator==(String lhs, String rhs) {
    if (lhs._data == rhs._data)
      return true;
    if (!lhs._data)
      return false;
    if (!rhs._data)
      return false;
    return strcmp(lhs._data, rhs._data) == 0;
  }

  friend bool operator!=(String lhs, String rhs) {
    if (lhs._data == rhs._data)
      return false;
    if (!lhs._data)
      return true;
    if (!rhs._data)
      return true;
    return strcmp(lhs._data, rhs._data) != 0;
  }

 private:
  const char* _data;
  bool _isStatic;
};

class StringAdapter : public RamStringAdapter {
 public:
  StringAdapter(const String& str)
      : RamStringAdapter(str.c_str()), _isStatic(str.isStatic()) {}

  bool isStatic() const {
    return _isStatic;
  }

  typedef storage_policies::decide_at_runtime storage_policy;

 private:
  bool _isStatic;
};

template <>
struct IsString<String> : true_type {};

inline StringAdapter adaptString(const String& str) {
  return StringAdapter(str);
}
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/.vscode/settings.json<|end_filename|>
{
  "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
  "cmake.generator": "Ninja",
  "git.inputValidationLength": 80,
  "git.inputValidationSubjectLength": 72,
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/Encoder/Encoder.cpp<|end_filename|>

#include "Encoder.h"

// Most the code is in the header file, to provide the user
// configure options with #define (before they include it), and
// to facilitate some crafty optimizations!

Encoder_internal_state_t * Encoder::interruptArgs[];

void ENCODER_ISR_ATTR Encoder::update(Encoder_internal_state_t *arg) {
#if defined(__AVR__)
	// The compiler believes this is just 1 line of code, so
	// it will inline this function into each interrupt
	// handler.  That's a tiny bit faster, but grows the code.
	// Especially when used with ENCODER_OPTIMIZE_INTERRUPTS,
	// the inline nature allows the ISR prologue and epilogue
	// to only save/restore necessary registers, for very nice
	// speed increase.
	asm volatile (
			"ld	r30, X+"		"\n\t"
			"ld	r31, X+"		"\n\t"
			"ld	r24, Z"			"\n\t"	// r24 = pin1 input
			"ld	r30, X+"		"\n\t"
			"ld	r31, X+"		"\n\t"
			"ld	r25, Z"			"\n\t"  // r25 = pin2 input
			"ld	r30, X+"		"\n\t"  // r30 = pin1 mask
			"ld	r31, X+"		"\n\t"	// r31 = pin2 mask
			"ld	r22, X"			"\n\t"	// r22 = state
			"andi	r22, 3"			"\n\t"
			"and	r24, r30"		"\n\t"
			"breq	L%=1"			"\n\t"	// if (pin1)
			"ori	r22, 4"			"\n\t"	//	state |= 4
			"L%=1:"	"and	r25, r31"		"\n\t"
			"breq	L%=2"			"\n\t"	// if (pin2)
			"ori	r22, 8"			"\n\t"	//	state |= 8
			"L%=2:" "ldi	r30, lo8(pm(L%=table))"	"\n\t"
			"ldi	r31, hi8(pm(L%=table))"	"\n\t"
			"add	r30, r22"		"\n\t"
			"adc	r31, __zero_reg__"	"\n\t"
			"asr	r22"			"\n\t"
			"asr	r22"			"\n\t"
			"st	X+, r22"		"\n\t"  // store new state
			"ld	r22, X+"		"\n\t"
			"ld	r23, X+"		"\n\t"
			"ld	r24, X+"		"\n\t"
			"ld	r25, X+"		"\n\t"
			"ijmp"				"\n\t"	// jumps to update_finishup()
			// TODO move this table to another static function,
			// so it doesn't get needlessly duplicated.  Easier
			// said than done, due to linker issues and inlining
			"L%=table:"				"\n\t"
			"rjmp	L%=end"			"\n\t"	// 0
			"rjmp	L%=plus1"		"\n\t"	// 1
			"rjmp	L%=minus1"		"\n\t"	// 2
			"rjmp	L%=plus2"		"\n\t"	// 3
			"rjmp	L%=minus1"		"\n\t"	// 4
			"rjmp	L%=end"			"\n\t"	// 5
			"rjmp	L%=minus2"		"\n\t"	// 6
			"rjmp	L%=plus1"		"\n\t"	// 7
			"rjmp	L%=plus1"		"\n\t"	// 8
			"rjmp	L%=minus2"		"\n\t"	// 9
			"rjmp	L%=end"			"\n\t"	// 10
			"rjmp	L%=minus1"		"\n\t"	// 11
			"rjmp	L%=plus2"		"\n\t"	// 12
			"rjmp	L%=minus1"		"\n\t"	// 13
			"rjmp	L%=plus1"		"\n\t"	// 14
			"rjmp	L%=end"			"\n\t"	// 15
			"L%=minus2:"				"\n\t"
			"subi	r22, 2"			"\n\t"
			"sbci	r23, 0"			"\n\t"
			"sbci	r24, 0"			"\n\t"
			"sbci	r25, 0"			"\n\t"
			"rjmp	L%=store"		"\n\t"
			"L%=minus1:"				"\n\t"
			"subi	r22, 1"			"\n\t"
			"sbci	r23, 0"			"\n\t"
			"sbci	r24, 0"			"\n\t"
			"sbci	r25, 0"			"\n\t"
			"rjmp	L%=store"		"\n\t"
			"L%=plus2:"				"\n\t"
			"subi	r22, 254"		"\n\t"
			"rjmp	L%=z"			"\n\t"
			"L%=plus1:"				"\n\t"
			"subi	r22, 255"		"\n\t"
			"L%=z:"	"sbci	r23, 255"		"\n\t"
			"sbci	r24, 255"		"\n\t"
			"sbci	r25, 255"		"\n\t"
			"L%=store:"				"\n\t"
			"st	-X, r25"		"\n\t"
			"st	-X, r24"		"\n\t"
			"st	-X, r23"		"\n\t"
			"st	-X, r22"		"\n\t"
			"L%=end:"				"\n"
			: : "x" (arg) : "r22", "r23", "r24", "r25", "r30", "r31");
#else
	uint8_t p1val = DIRECT_PIN_READ(arg->pin1_register, arg->pin1_bitmask);
	uint8_t p2val = DIRECT_PIN_READ(arg->pin2_register, arg->pin2_bitmask);
	uint8_t state = arg->state & 3;
	if (p1val) state |= 4;
	if (p2val) state |= 8;
	arg->state = (state >> 2);
	switch (state) {
		case 1: case 7: case 8: case 14:
			arg->position++;
			return;
		case 2: case 4: case 11: case 13:
			arg->position--;
			return;
		case 3: case 12:
			arg->position += 2;
			return;
		case 6: case 9:
			arg->position -= 2;
			return;
	}
#endif
}

#if defined(ENCODER_USE_INTERRUPTS) && !defined(ENCODER_OPTIMIZE_INTERRUPTS)
	#ifdef CORE_INT0_PIN
	void ENCODER_ISR_ATTR Encoder::isr0(void) { update(interruptArgs[0]); }
	#endif
	#ifdef CORE_INT1_PIN
	void ENCODER_ISR_ATTR Encoder::isr1(void) { update(interruptArgs[1]); }
	#endif
	#ifdef CORE_INT2_PIN
	void ENCODER_ISR_ATTR Encoder::isr2(void) { update(interruptArgs[2]); }
	#endif
	#ifdef CORE_INT3_PIN
	void ENCODER_ISR_ATTR Encoder::isr3(void) { update(interruptArgs[3]); }
	#endif
	#ifdef CORE_INT4_PIN
	void ENCODER_ISR_ATTR Encoder::isr4(void) { update(interruptArgs[4]); }
	#endif
	#ifdef CORE_INT5_PIN
	void ENCODER_ISR_ATTR Encoder::isr5(void) { update(interruptArgs[5]); }
	#endif
	#ifdef CORE_INT6_PIN
	void ENCODER_ISR_ATTR Encoder::isr6(void) { update(interruptArgs[6]); }
	#endif
	#ifdef CORE_INT7_PIN
	void ENCODER_ISR_ATTR Encoder::isr7(void) { update(interruptArgs[7]); }
	#endif
	#ifdef CORE_INT8_PIN
	void ENCODER_ISR_ATTR Encoder::isr8(void) { update(interruptArgs[8]); }
	#endif
	#ifdef CORE_INT9_PIN
	void ENCODER_ISR_ATTR Encoder::isr9(void) { update(interruptArgs[9]); }
	#endif
	#ifdef CORE_INT10_PIN
	void ENCODER_ISR_ATTR Encoder::isr10(void) { update(interruptArgs[10]); }
	#endif
	#ifdef CORE_INT11_PIN
	void ENCODER_ISR_ATTR Encoder::isr11(void) { update(interruptArgs[11]); }
	#endif
	#ifdef CORE_INT12_PIN
	void ENCODER_ISR_ATTR Encoder::isr12(void) { update(interruptArgs[12]); }
	#endif
	#ifdef CORE_INT13_PIN
	void ENCODER_ISR_ATTR Encoder::isr13(void) { update(interruptArgs[13]); }
	#endif
	#ifdef CORE_INT14_PIN
	void ENCODER_ISR_ATTR Encoder::isr14(void) { update(interruptArgs[14]); }
	#endif
	#ifdef CORE_INT15_PIN
	void ENCODER_ISR_ATTR Encoder::isr15(void) { update(interruptArgs[15]); }
	#endif
	#ifdef CORE_INT16_PIN
	void ENCODER_ISR_ATTR Encoder::isr16(void) { update(interruptArgs[16]); }
	#endif
	#ifdef CORE_INT17_PIN
	void ENCODER_ISR_ATTR Encoder::isr17(void) { update(interruptArgs[17]); }
	#endif
	#ifdef CORE_INT18_PIN
	void ENCODER_ISR_ATTR Encoder::isr18(void) { update(interruptArgs[18]); }
	#endif
	#ifdef CORE_INT19_PIN
	void ENCODER_ISR_ATTR Encoder::isr19(void) { update(interruptArgs[19]); }
	#endif
	#ifdef CORE_INT20_PIN
	void ENCODER_ISR_ATTR Encoder::isr20(void) { update(interruptArgs[20]); }
	#endif
	#ifdef CORE_INT21_PIN
	void ENCODER_ISR_ATTR Encoder::isr21(void) { update(interruptArgs[21]); }
	#endif
	#ifdef CORE_INT22_PIN
	void ENCODER_ISR_ATTR Encoder::isr22(void) { update(interruptArgs[22]); }
	#endif
	#ifdef CORE_INT23_PIN
	void ENCODER_ISR_ATTR Encoder::isr23(void) { update(interruptArgs[23]); }
	#endif
	#ifdef CORE_INT24_PIN
	void ENCODER_ISR_ATTR Encoder::isr24(void) { update(interruptArgs[24]); }
	#endif
	#ifdef CORE_INT25_PIN
	void ENCODER_ISR_ATTR Encoder::isr25(void) { update(interruptArgs[25]); }
	#endif
	#ifdef CORE_INT26_PIN
	void ENCODER_ISR_ATTR Encoder::isr26(void) { update(interruptArgs[26]); }
	#endif
	#ifdef CORE_INT27_PIN
	void ENCODER_ISR_ATTR Encoder::isr27(void) { update(interruptArgs[27]); }
	#endif
	#ifdef CORE_INT28_PIN
	void ENCODER_ISR_ATTR Encoder::isr28(void) { update(interruptArgs[28]); }
	#endif
	#ifdef CORE_INT29_PIN
	void ENCODER_ISR_ATTR Encoder::isr29(void) { update(interruptArgs[29]); }
	#endif
	#ifdef CORE_INT30_PIN
	void ENCODER_ISR_ATTR Encoder::isr30(void) { update(interruptArgs[30]); }
	#endif
	#ifdef CORE_INT31_PIN
	void ENCODER_ISR_ATTR Encoder::isr31(void) { update(interruptArgs[31]); }
	#endif
	#ifdef CORE_INT32_PIN
	void ENCODER_ISR_ATTR Encoder::isr32(void) { update(interruptArgs[32]); }
	#endif
	#ifdef CORE_INT33_PIN
	void ENCODER_ISR_ATTR Encoder::isr33(void) { update(interruptArgs[33]); }
	#endif
	#ifdef CORE_INT34_PIN
	void ENCODER_ISR_ATTR Encoder::isr34(void) { update(interruptArgs[34]); }
	#endif
	#ifdef CORE_INT35_PIN
	void ENCODER_ISR_ATTR Encoder::isr35(void) { update(interruptArgs[35]); }
	#endif
	#ifdef CORE_INT36_PIN
	void ENCODER_ISR_ATTR Encoder::isr36(void) { update(interruptArgs[36]); }
	#endif
	#ifdef CORE_INT37_PIN
	void ENCODER_ISR_ATTR Encoder::isr37(void) { update(interruptArgs[37]); }
	#endif
	#ifdef CORE_INT38_PIN
	void ENCODER_ISR_ATTR Encoder::isr38(void) { update(interruptArgs[38]); }
	#endif
	#ifdef CORE_INT39_PIN
	void ENCODER_ISR_ATTR Encoder::isr39(void) { update(interruptArgs[39]); }
	#endif
	#ifdef CORE_INT40_PIN
	void ENCODER_ISR_ATTR Encoder::isr40(void) { update(interruptArgs[40]); }
	#endif
	#ifdef CORE_INT41_PIN
	void ENCODER_ISR_ATTR Encoder::isr41(void) { update(interruptArgs[41]); }
	#endif
	#ifdef CORE_INT42_PIN
	void ENCODER_ISR_ATTR Encoder::isr42(void) { update(interruptArgs[42]); }
	#endif
	#ifdef CORE_INT43_PIN
	void ENCODER_ISR_ATTR Encoder::isr43(void) { update(interruptArgs[43]); }
	#endif
	#ifdef CORE_INT44_PIN
	void ENCODER_ISR_ATTR Encoder::isr44(void) { update(interruptArgs[44]); }
	#endif
	#ifdef CORE_INT45_PIN
	void ENCODER_ISR_ATTR Encoder::isr45(void) { update(interruptArgs[45]); }
	#endif
	#ifdef CORE_INT46_PIN
	void ENCODER_ISR_ATTR Encoder::isr46(void) { update(interruptArgs[46]); }
	#endif
	#ifdef CORE_INT47_PIN
	void ENCODER_ISR_ATTR Encoder::isr47(void) { update(interruptArgs[47]); }
	#endif
	#ifdef CORE_INT48_PIN
	void ENCODER_ISR_ATTR Encoder::isr48(void) { update(interruptArgs[48]); }
	#endif
	#ifdef CORE_INT49_PIN
	void ENCODER_ISR_ATTR Encoder::isr49(void) { update(interruptArgs[49]); }
	#endif
	#ifdef CORE_INT50_PIN
	void ENCODER_ISR_ATTR Encoder::isr50(void) { update(interruptArgs[50]); }
	#endif
	#ifdef CORE_INT51_PIN
	void ENCODER_ISR_ATTR Encoder::isr51(void) { update(interruptArgs[51]); }
	#endif
	#ifdef CORE_INT52_PIN
	void ENCODER_ISR_ATTR Encoder::isr52(void) { update(interruptArgs[52]); }
	#endif
	#ifdef CORE_INT53_PIN
	void ENCODER_ISR_ATTR Encoder::isr53(void) { update(interruptArgs[53]); }
	#endif
	#ifdef CORE_INT54_PIN
	void ENCODER_ISR_ATTR Encoder::isr54(void) { update(interruptArgs[54]); }
	#endif
	#ifdef CORE_INT55_PIN
	void ENCODER_ISR_ATTR Encoder::isr55(void) { update(interruptArgs[55]); }
	#endif
	#ifdef CORE_INT56_PIN
	void ENCODER_ISR_ATTR Encoder::isr56(void) { update(interruptArgs[56]); }
	#endif
	#ifdef CORE_INT57_PIN
	void ENCODER_ISR_ATTR Encoder::isr57(void) { update(interruptArgs[57]); }
	#endif
	#ifdef CORE_INT58_PIN
	void ENCODER_ISR_ATTR Encoder::isr58(void) { update(interruptArgs[58]); }
	#endif
	#ifdef CORE_INT59_PIN
	void ENCODER_ISR_ATTR Encoder::isr59(void) { update(interruptArgs[59]); }
	#endif
#endif


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/TextFormatter/writeFloat.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <catch.hpp>
#include <limits>
#include <string>

#define ARDUINOJSON_ENABLE_NAN 1
#define ARDUINOJSON_ENABLE_INFINITY 1
#include <ArduinoJson/Json/TextFormatter.hpp>
#include <ArduinoJson/Serialization/Writer.hpp>

using namespace ARDUINOJSON_NAMESPACE;

template <typename TFloat>
void check(TFloat input, const std::string& expected) {
  std::string output;
  Writer<std::string> sb(output);
  TextFormatter<Writer<std::string> > writer(sb);
  writer.writeFloat(input);
  REQUIRE(writer.bytesWritten() == output.size());
  CHECK(expected == output);
}

TEST_CASE("TextFormatter::writeFloat(double)") {
  SECTION("Pi") {
    check<double>(3.14159265359, "3.141592654");
  }

  SECTION("Signaling NaN") {
    double nan = std::numeric_limits<double>::signaling_NaN();
    check<double>(nan, "NaN");
  }

  SECTION("Quiet NaN") {
    double nan = std::numeric_limits<double>::quiet_NaN();
    check<double>(nan, "NaN");
  }

  SECTION("Infinity") {
    double inf = std::numeric_limits<double>::infinity();
    check<double>(inf, "Infinity");
    check<double>(-inf, "-Infinity");
  }

  SECTION("Zero") {
    check<double>(0.0, "0");
    check<double>(-0.0, "0");
  }

  SECTION("Espilon") {
    check<double>(2.2250738585072014E-308, "2.225073859e-308");
    check<double>(-2.2250738585072014E-308, "-2.225073859e-308");
  }

  SECTION("Max double") {
    check<double>(1.7976931348623157E+308, "1.797693135e308");
    check<double>(-1.7976931348623157E+308, "-1.797693135e308");
  }

  SECTION("Big exponent") {
    // this test increases coverage of normalize()
    check<double>(1e255, "1e255");
    check<double>(1e-255, "1e-255");
  }

  SECTION("Exponentation when <= 1e-5") {
    check<double>(1e-4, "0.0001");
    check<double>(1e-5, "1e-5");

    check<double>(-1e-4, "-0.0001");
    check<double>(-1e-5, "-1e-5");
  }

  SECTION("Exponentation when >= 1e7") {
    check<double>(9999999.999, "9999999.999");
    check<double>(10000000.0, "1e7");

    check<double>(-9999999.999, "-9999999.999");
    check<double>(-10000000.0, "-1e7");
  }

  SECTION("Rounding when too many decimals") {
    check<double>(0.000099999999999, "0.0001");
    check<double>(0.0000099999999999, "1e-5");
    check<double>(0.9999999996, "1");
  }

  SECTION("9 decimal places") {
    check<double>(0.100000001, "0.100000001");
    check<double>(0.999999999, "0.999999999");

    check<double>(9.000000001, "9.000000001");
    check<double>(9.999999999, "9.999999999");
  }

  SECTION("10 decimal places") {
    check<double>(0.1000000001, "0.1");
    check<double>(0.9999999999, "1");

    check<double>(9.0000000001, "9");
    check<double>(9.9999999999, "10");
  }
}

TEST_CASE("TextFormatter::writeFloat(float)") {
  SECTION("Pi") {
    check<float>(3.14159265359f, "3.141593");
  }

  SECTION("999.9") {  // issue #543
    check<float>(999.9f, "999.9");
  }

  SECTION("24.3") {  // # issue #588
    check<float>(24.3f, "24.3");
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MixedConfiguration/enable_nan_0.cpp<|end_filename|>
#define ARDUINOJSON_ENABLE_NAN 0
#include <ArduinoJson.h>

#include <catch.hpp>
#include <limits>

TEST_CASE("ARDUINOJSON_ENABLE_NAN == 0") {
  DynamicJsonDocument doc(4096);
  JsonObject root = doc.to<JsonObject>();

  SECTION("serializeJson()") {
    root["X"] = std::numeric_limits<double>::signaling_NaN();

    std::string json;
    serializeJson(doc, json);

    REQUIRE(json == "{\"X\":null}");
  }

  SECTION("deserializeJson()") {
    auto err = deserializeJson(doc, "{\"X\":NaN}");

    REQUIRE(err == DeserializationError::InvalidInput);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MsgPackDeserializer/notSupported.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

static void checkMsgPackDocument(const char* input, size_t inputSize,
                                 const char* expectedJson) {
  DynamicJsonDocument doc(4096);

  DeserializationError error = deserializeMsgPack(doc, input, inputSize);

  REQUIRE(error == DeserializationError::Ok);
  std::string actualJson;
  serializeJson(doc, actualJson);
  REQUIRE(actualJson == expectedJson);
}

static void checkMsgPackError(const char* input, size_t inputSize,
                              DeserializationError expectedError) {
  DynamicJsonDocument doc(4096);

  DeserializationError error = deserializeMsgPack(doc, input, inputSize);

  REQUIRE(error == expectedError);
}

TEST_CASE("deserializeMsgPack() return NotSupported") {
  SECTION("bin 8") {
    checkMsgPackDocument("\x92\xc4\x01X\x2A", 5, "[null,42]");
  }

  SECTION("bin 16") {
    checkMsgPackDocument("\x92\xc5\x00\x01X\x2A", 6, "[null,42]");
  }

  SECTION("bin 32") {
    checkMsgPackDocument("\x92\xc6\x00\x00\x00\x01X\x2A", 8, "[null,42]");
  }

  SECTION("ext 8") {
    checkMsgPackDocument("\x92\xc7\x01\x01\x01\x2A", 6, "[null,42]");
  }

  SECTION("ext 16") {
    checkMsgPackDocument("\x92\xc8\x00\x01\x01\x01\x2A", 7, "[null,42]");
  }

  SECTION("ext 32") {
    checkMsgPackDocument("\x92\xc9\x00\x00\x00\x01\x01\x01\x2A", 9,
                         "[null,42]");
  }

  SECTION("fixext 1") {
    checkMsgPackDocument("\x92\xd4\x01\x01\x2A", 5, "[null,42]");
  }

  SECTION("fixext 2") {
    checkMsgPackDocument("\x92\xd5\x01\x01\x02\x2A", 6, "[null,42]");
  }

  SECTION("fixext 4") {
    checkMsgPackDocument("\x92\xd6\x01\x01\x02\x03\x04\x2A", 8, "[null,42]");
  }

  SECTION("fixext 8") {
    checkMsgPackDocument("\x92\xd7\x01\x01\x02\x03\x04\x05\x06\x07\x08\x2A", 12,
                         "[null,42]");
  }

  SECTION("fixext 16") {
    checkMsgPackDocument(
        "\x92\xd8\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E"
        "\x0F\x10\x2A",
        20, "[null,42]");
  }

  SECTION("integer as key") {
    checkMsgPackError("\x81\x01\xA1H", 3, DeserializationError::InvalidInput);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MixedConfiguration/use_long_long_1.cpp<|end_filename|>
#define ARDUINOJSON_USE_LONG_LONG 1
#include <ArduinoJson.h>

#include <catch.hpp>

TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 1") {
  DynamicJsonDocument doc(4096);
  JsonObject root = doc.to<JsonObject>();

  root["A"] = 123456789123456789;
  root["B"] = 987654321987654321;

  std::string json;
  serializeJson(doc, json);

  REQUIRE(json == "{\"A\":123456789123456789,\"B\":987654321987654321}");
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/StringStorage/StringCopier.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Memory/MemoryPool.hpp>

namespace ARDUINOJSON_NAMESPACE {

class StringCopier {
 public:
  StringCopier(MemoryPool& pool) : _pool(&pool) {}

  void startString() {
    _pool->getFreeZone(&_ptr, &_capacity);
    _size = 0;
  }

  const char* save() {
    ARDUINOJSON_ASSERT(_ptr);
    return _pool->saveStringFromFreeZone(_size);
  }

  void append(const char* s) {
    while (*s) append(*s++);
  }

  void append(const char* s, size_t n) {
    while (n-- > 0) append(*s++);
  }

  void append(char c) {
    if (!_ptr)
      return;

    if (_size >= _capacity) {
      _ptr = 0;
      _pool->markAsOverflowed();
      return;
    }

    _ptr[_size++] = c;
  }

  bool isValid() {
    return _ptr != 0;
  }

  const char* c_str() {
    return _ptr;
  }

  typedef storage_policies::store_by_copy storage_policy;

 private:
  MemoryPool* _pool;
  char* _ptr;
  size_t _size;
  size_t _capacity;
};
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MixedConfiguration/enable_comments_0.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#define ARDUINOJSON_ENABLE_COMMENTS 0
#include <ArduinoJson.h>

#include <catch.hpp>

TEST_CASE("Comments should produce InvalidInput") {
  DynamicJsonDocument doc(2048);

  const char* testCases[] = {
      "/*COMMENT*/  [\"hello\"]",
      "[/*COMMENT*/ \"hello\"]",
      "[\"hello\"/*COMMENT*/]",
      "[\"hello\"/*COMMENT*/,\"world\"]",
      "[\"hello\",/*COMMENT*/ \"world\"]",
      "[/*/\n]",
      "[/*COMMENT]",
      "[/*COMMENT*]",
      "//COMMENT\n\t[\"hello\"]",
      "[//COMMENT\n\"hello\"]",
      "[\"hello\"//COMMENT\r\n]",
      "[\"hello\"//COMMENT\n,\"world\"]",
      "[\"hello\",//COMMENT\n\"world\"]",
      "[/COMMENT\n]",
      "[//COMMENT",
      "/*COMMENT*/ {\"hello\":\"world\"}",
      "{/*COMMENT*/\"hello\":\"world\"}",
      "{\"hello\"/*COMMENT*/:\"world\"}",
      "{\"hello\":/*COMMENT*/\"world\"}",
      "{\"hello\":\"world\"/*COMMENT*/}",
      "//COMMENT\n {\"hello\":\"world\"}",
      "{//COMMENT\n\"hello\":\"world\"}",
      "{\"hello\"//COMMENT\n:\"world\"}",
      "{\"hello\"://COMMENT\n\"world\"}",
      "{\"hello\":\"world\"//COMMENT\n}",
      "/{\"hello\":\"world\"}",
      "{/\"hello\":\"world\"}",
      "{\"hello\"/:\"world\"}",
      "{\"hello\":/\"world\"}",
      "{\"hello\":\"world\"/}",
      "{\"hello\":\"world\"/,\"answer\":42}",
      "{\"hello\":\"world\",/\"answer\":42}",
  };
  const size_t testCount = sizeof(testCases) / sizeof(testCases[0]);

  for (size_t i = 0; i < testCount; i++) {
    const char* input = testCases[i];
    CAPTURE(input);
    REQUIRE(deserializeJson(doc, input) == DeserializationError::InvalidInput);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MsgPackSerializer/serializeArray.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

static void check(const JsonArray array, const char* expected_data,
                  size_t expected_len) {
  std::string expected(expected_data, expected_data + expected_len);
  std::string actual;
  size_t len = serializeMsgPack(array, actual);
  CAPTURE(array);
  REQUIRE(len == expected_len);
  REQUIRE(actual == expected);
}

template <size_t N>
static void check(const JsonArray array, const char (&expected_data)[N]) {
  const size_t expected_len = N - 1;
  check(array, expected_data, expected_len);
}

static void check(const JsonArray array, const std::string& expected) {
  check(array, expected.data(), expected.length());
}

TEST_CASE("serialize MsgPack array") {
  DynamicJsonDocument doc(JSON_ARRAY_SIZE(65536));
  JsonArray array = doc.to<JsonArray>();

  SECTION("empty") {
    check(array, "\x90");
  }

  SECTION("fixarray") {
    array.add("hello");
    array.add("world");

    check(array, "\x92\xA5hello\xA5world");
  }

  SECTION("array 16") {
    for (int i = 0; i < 16; i++) array.add(i);

    check(array,
          "\xDC\x00\x10\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D"
          "\x0E\x0F");
  }

  SECTION("array 32") {
    const char* nil = 0;
    for (int i = 0; i < 65536; i++) array.add(nil);

    check(array,
          std::string("\xDD\x00\x01\x00\x00", 5) + std::string(65536, '\xc0'));
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/component.mk<|end_filename|>
COMPONENT_ADD_INCLUDEDIRS := src


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Misc/custom_string.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <string>

struct custom_char_traits : std::char_traits<char> {};
struct custom_allocator : std::allocator<char> {};
typedef std::basic_string<char, custom_char_traits, custom_allocator>
    custom_string;


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Array/Utilities.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Array/ArrayRef.hpp>
#include <ArduinoJson/Document/JsonDocument.hpp>
#include <ArduinoJson/Variant/Visitor.hpp>

namespace ARDUINOJSON_NAMESPACE {

// Copy a 1D array to a JsonArray
template <typename T, size_t N, typename TDestination>
inline typename enable_if<!is_array<T>::value &&
                              !is_base_of<JsonDocument, TDestination>::value,
                          bool>::type
copyArray(T (&src)[N], const TDestination& dst) {
  return copyArray(src, N, dst);
}

// Copy a 1D array to a JsonDocument
template <typename T, size_t N>
inline bool copyArray(T (&src)[N], JsonDocument& dst) {
  return copyArray(src, dst.to<ArrayRef>());
}

// Copy a 1D array to a JsonArray
template <typename T, typename TDestination>
inline typename enable_if<!is_array<T>::value &&
                              !is_base_of<JsonDocument, TDestination>::value,
                          bool>::type
copyArray(T* src, size_t len, const TDestination& dst) {
  bool ok = true;
  for (size_t i = 0; i < len; i++) {
    ok &= dst.add(src[i]);
  }
  return ok;
}

// Copy a 1D array to a JsonDocument
template <typename T>
inline bool copyArray(T* src, size_t len, JsonDocument& dst) {
  return copyArray(src, len, dst.to<ArrayRef>());
}

// Copy a 2D array to a JsonArray
template <typename T, size_t N1, size_t N2, typename TDestination>
inline typename enable_if<!is_base_of<JsonDocument, TDestination>::value,
                          bool>::type
copyArray(T (&src)[N1][N2], const TDestination& dst) {
  bool ok = true;
  for (size_t i = 0; i < N1; i++) {
    ArrayRef nestedArray = dst.createNestedArray();
    for (size_t j = 0; j < N2; j++) {
      ok &= nestedArray.add(src[i][j]);
    }
  }
  return ok;
}

// Copy a 2D array to a JsonDocument
template <typename T, size_t N1, size_t N2>
inline bool copyArray(T (&src)[N1][N2], JsonDocument& dst) {
  return copyArray(src, dst.to<ArrayRef>());
}

template <typename T>
class ArrayCopier1D : public Visitor<size_t> {
 public:
  ArrayCopier1D(T* destination, size_t capacity)
      : _destination(destination), _capacity(capacity) {}

  size_t visitArray(const CollectionData& array) {
    size_t size = 0;
    VariantSlot* slot = array.head();

    while (slot != 0 && size < _capacity) {
      _destination[size++] =
          Converter<T>::fromJson(VariantConstRef(slot->data()));
      slot = slot->next();
    }
    return size;
  }

 private:
  T* _destination;
  size_t _capacity;
};

template <typename T, size_t N1, size_t N2>
class ArrayCopier2D : public Visitor<void> {
 public:
  ArrayCopier2D(T (*destination)[N1][N2]) : _destination(destination) {}

  void visitArray(const CollectionData& array) {
    VariantSlot* slot = array.head();
    size_t n = 0;
    while (slot != 0 && n < N1) {
      ArrayCopier1D<T> copier((*_destination)[n++], N2);
      variantAccept(slot->data(), copier);
      slot = slot->next();
    }
  }

 private:
  T (*_destination)[N1][N2];
  size_t _capacity1, _capacity2;
};

// Copy a JsonArray to a 1D array
template <typename TSource, typename T, size_t N>
inline typename enable_if<!is_array<T>::value, size_t>::type copyArray(
    const TSource& src, T (&dst)[N]) {
  return copyArray(src, dst, N);
}

// Copy a JsonArray to a 1D array
template <typename TSource, typename T>
inline size_t copyArray(const TSource& src, T* dst, size_t len) {
  ArrayCopier1D<T> copier(dst, len);

  return src.accept(copier);
}

// Copy a JsonArray to a 2D array
template <typename TSource, typename T, size_t N1, size_t N2>
inline void copyArray(const TSource& src, T (&dst)[N1][N2]) {
  ArrayCopier2D<T, N1, N2> copier(&dst);
  src.accept(copier);
}

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Polyfills/utility.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include "type_traits.hpp"

namespace ARDUINOJSON_NAMESPACE {
template <typename T>
inline void swap(T& a, T& b) {
  T t(a);
  a = b;
  b = t;
}

#if ARDUINOJSON_HAS_RVALUE_REFERENCES
template <typename T>
typename remove_reference<T>::type&& move(T&& t) {
  return static_cast<typename remove_reference<T>::type&&>(t);
}
#else
template <typename T>
T& move(T& t) {
  return t;
}
#endif
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Misc/deprecated.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#define ARDUINOJSON_DEPRECATED(msg)  // nothing

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("Deprecated features") {
  StaticJsonDocument<256> doc;
  const char* s = "hello";
  doc["s"] = s;
  doc["c"] = 42;
  doc["a"].add(s);
  doc["a"].add(42);

  SECTION("JsonVariant::add(char)") {
    JsonVariant v = doc.to<JsonVariant>();
    v.add('*');
    REQUIRE(v[0] == 42);
  }

  SECTION("JsonVariant::as<char*>()") {
    JsonVariant v = doc["s"];
    REQUIRE(v.as<char*>() == s);
  }

  SECTION("JsonVariant::as<char>()") {
    JsonVariant v = doc["c"];
    REQUIRE(v.as<char>() == '*');
  }

  SECTION("JsonVariant::is<char*>()") {
    JsonVariant v = doc["s"];
    REQUIRE(v.is<char*>() == true);
  }

  SECTION("JsonVariant::is<char>()") {
    JsonVariant v = doc["c"];
    REQUIRE(v.is<char>() == true);
  }

  SECTION("JsonVariant::set(char)") {
    JsonVariant v = doc.to<JsonVariant>();
    v.set('*');
    REQUIRE(v.as<unsigned char>() == 42);
  }

  SECTION("JsonVariantConst::as<char*>()") {
    JsonVariantConst v = doc["s"];
    REQUIRE(v.as<char*>() == s);
  }

  SECTION("JsonVariantConst::as<char>()") {
    JsonVariantConst v = doc["c"];
    REQUIRE(v.as<char>() == '*');
  }

  SECTION("JsonVariantConst::is<char*>()") {
    JsonVariantConst v = doc["s"];
    REQUIRE(v.is<char*>() == true);
  }

  SECTION("JsonVariantConst::is<char>()") {
    JsonVariantConst v = doc["c"];
    REQUIRE(v.is<char>() == true);
  }

  SECTION("MemberProxy::as<char*>()") {
    REQUIRE(doc["s"].as<char*>() == s);
  }

  SECTION("MemberProxy::as<char>()") {
    REQUIRE(doc["c"].as<char>() == '*');
  }

  SECTION("MemberProxy::as<char>()") {
    doc["x"].set('*');
    REQUIRE(doc["x"] == 42);
  }

  SECTION("MemberProxy::is<char*>()") {
    REQUIRE(doc["s"].is<char*>() == true);
    REQUIRE(doc["c"].is<char*>() == false);
  }

  SECTION("MemberProxy::is<char>()") {
    REQUIRE(doc["c"].is<char>() == true);
    REQUIRE(doc["s"].is<char>() == false);
  }

  SECTION("ElementProxy::as<char*>()") {
    REQUIRE(doc["a"][0].as<char*>() == s);
  }

  SECTION("ElementProxy::as<char>()") {
    REQUIRE(doc["a"][1].as<char>() == '*');
  }

  SECTION("ElementProxy::as<char>()") {
    doc["a"][0].set('*');
    REQUIRE(doc["a"][0] == 42);
  }

  SECTION("ElementProxy::is<char*>()") {
    REQUIRE(doc["a"][0].is<char*>() == true);
    REQUIRE(doc["a"][1].is<char*>() == false);
  }

  SECTION("ElementProxy::is<char>()") {
    REQUIRE(doc["a"][1].is<char>() == true);
    REQUIRE(doc["a"][0].is<char>() == false);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Object/ObjectShortcuts.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Polyfills/attributes.hpp>
#include <ArduinoJson/Polyfills/type_traits.hpp>
#include <ArduinoJson/Strings/StringAdapters.hpp>

namespace ARDUINOJSON_NAMESPACE {
template <typename TParent, typename TStringRef>
class MemberProxy;

template <typename TObject>
class ObjectShortcuts {
 public:
  // containsKey(const std::string&) const
  // containsKey(const String&) const
  template <typename TString>
  FORCE_INLINE typename enable_if<IsString<TString>::value, bool>::type
  containsKey(const TString &key) const;

  // containsKey(char*) const
  // containsKey(const char*) const
  // containsKey(const __FlashStringHelper*) const
  template <typename TChar>
  FORCE_INLINE typename enable_if<IsString<TChar *>::value, bool>::type
  containsKey(TChar *key) const;

  // operator[](const std::string&) const
  // operator[](const String&) const
  template <typename TString>
  FORCE_INLINE typename enable_if<IsString<TString>::value,
                                  MemberProxy<TObject, TString> >::type
  operator[](const TString &key) const;

  // operator[](char*) const
  // operator[](const char*) const
  // operator[](const __FlashStringHelper*) const
  template <typename TChar>
  FORCE_INLINE typename enable_if<IsString<TChar *>::value,
                                  MemberProxy<TObject, TChar *> >::type
  operator[](TChar *key) const;

  // createNestedArray(const std::string&) const
  // createNestedArray(const String&) const
  template <typename TString>
  FORCE_INLINE ArrayRef createNestedArray(const TString &key) const;

  // createNestedArray(char*) const
  // createNestedArray(const char*) const
  // createNestedArray(const __FlashStringHelper*) const
  template <typename TChar>
  FORCE_INLINE ArrayRef createNestedArray(TChar *key) const;

  // createNestedObject(const std::string&) const
  // createNestedObject(const String&) const
  template <typename TString>
  ObjectRef createNestedObject(const TString &key) const;

  // createNestedObject(char*) const
  // createNestedObject(const char*) const
  // createNestedObject(const __FlashStringHelper*) const
  template <typename TChar>
  ObjectRef createNestedObject(TChar *key) const;

 private:
  const TObject *impl() const {
    return static_cast<const TObject *>(this);
  }
};
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/ArduinoJson.h<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include "src/ArduinoJson.h"


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/scripts/wandbox/JsonGeneratorExample.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License
//
// This example shows how to generate a JSON document with ArduinoJson.

#include <iostream>
#include "ArduinoJson.h"

int main() {
  // Allocate the JSON document
  //
  // Inside the brackets, 200 is the RAM allocated to this document.
  // Don't forget to change this value to match your requirement.
  // Use https://arduinojson.org/v6/assistant to compute the capacity.
  StaticJsonDocument<200> doc;

  // StaticJsonObject allocates memory on the stack, it can be
  // replaced by DynamicJsonDocument which allocates in the heap.
  //
  // DynamicJsonDocument  doc(200);

  // StaticJsonObject allocates memory on the stack, it can be
  // replaced by DynamicJsonDocument which allocates in the heap.
  //
  // DynamicJsonDocument  doc(200);

  // Add values in the document
  //
  doc["sensor"] = "gps";
  doc["time"] = 1351824120;

  // Add an array.
  //
  JsonArray data = doc.createNestedArray("data");
  data.add(48.756080);
  data.add(2.302038);

  // Generate the minified JSON and send it to STDOUT
  //
  serializeJson(doc, std::cout);
  // The above line prints:
  // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}

  // Start a new line
  std::cout << std::endl;

  // Generate the prettified JSON and send it to STDOUT
  //
  serializeJsonPretty(doc, std::cout);
  // The above line prints:
  // {
  //   "sensor": "gps",
  //   "time": 1351824120,
  //   "data": [
  //     48.756080,
  //     2.302038
  //   ]
  // }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Helpers/progmem_emulation.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <stdint.h>  // uint8_t
#include <string.h>  // strcmp, strlen...

#define PROGMEM

class __FlashStringHelper;

inline const void* convertPtrToFlash(const void* s) {
  return reinterpret_cast<const char*>(s) + 42;
}

inline const void* convertFlashToPtr(const void* s) {
  return reinterpret_cast<const char*>(s) - 42;
}

#define PSTR(X) reinterpret_cast<const char*>(convertPtrToFlash(X))
#define F(X) reinterpret_cast<const __FlashStringHelper*>(PSTR(X))

inline uint8_t pgm_read_byte(const void* p) {
  return *reinterpret_cast<const uint8_t*>(convertFlashToPtr(p));
}

inline void* pgm_read_ptr(const void* p) {
  return *reinterpret_cast<void* const*>(convertFlashToPtr(p));
}

inline float pgm_read_float(const void* p) {
  return *reinterpret_cast<const float*>(convertFlashToPtr(p));
}

inline uint32_t pgm_read_dword(const void* p) {
  return *reinterpret_cast<const uint32_t*>(convertFlashToPtr(p));
}

#define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value)         \
  static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = value; \
  static type const* name = reinterpret_cast<type const*>(         \
      convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem)));


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Strings/RamStringAdapter.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Strings/ConstRamStringAdapter.hpp>
#include <ArduinoJson/Strings/IsString.hpp>
#include <ArduinoJson/Strings/StoragePolicy.hpp>

namespace ARDUINOJSON_NAMESPACE {

class RamStringAdapter : public ConstRamStringAdapter {
 public:
  RamStringAdapter(const char* str) : ConstRamStringAdapter(str) {}

  void copyTo(char* p, size_t n) const {
    memcpy(p, _str, n);
  }

  typedef ARDUINOJSON_NAMESPACE::storage_policies::store_by_copy storage_policy;
};

template <typename TChar>
inline RamStringAdapter adaptString(const TChar* str) {
  return RamStringAdapter(reinterpret_cast<const char*>(str));
}

inline RamStringAdapter adaptString(char* str) {
  return RamStringAdapter(str);
}

template <typename TChar>
struct IsString<TChar*> {
  static const bool value = sizeof(TChar) == 1;
};

template <>
struct IsString<void*> {
  static const bool value = false;
};

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonVariant/memoryUsage.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>
#include <string>

TEST_CASE("JsonVariant::memoryUsage()") {
  DynamicJsonDocument doc(4096);
  JsonVariant var = doc.to<JsonVariant>();

  SECTION("returns 0 if uninitialized") {
    JsonVariant unitialized;
    REQUIRE(unitialized.memoryUsage() == 0);
  }

  SECTION("returns size of object") {
    JsonObject obj = var.to<JsonObject>();
    obj["hello"] = 42;
    REQUIRE(var.memoryUsage() == JSON_OBJECT_SIZE(1));
  }

  SECTION("returns size of array") {
    JsonArray arr = var.to<JsonArray>();
    arr.add(42);
    REQUIRE(var.memoryUsage() == JSON_ARRAY_SIZE(1));
  }

  SECTION("returns size of owned string") {
    var.set(std::string("hello"));
    REQUIRE(var.memoryUsage() == 6);
  }

  SECTION("returns size of owned raw") {
    var.set(serialized(std::string("hello")));
    REQUIRE(var.memoryUsage() == 5);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Numbers/FloatTraits.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <stddef.h>  // for size_t
#include <stdint.h>

#include <ArduinoJson/Configuration.hpp>
#include <ArduinoJson/Polyfills/alias_cast.hpp>
#include <ArduinoJson/Polyfills/math.hpp>
#include <ArduinoJson/Polyfills/preprocessor.hpp>
#include <ArduinoJson/Polyfills/static_array.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename T, size_t = sizeof(T)>
struct FloatTraits {};

template <typename T>
struct FloatTraits<T, 8 /*64bits*/> {
  typedef uint64_t mantissa_type;
  static const short mantissa_bits = 52;
  static const mantissa_type mantissa_max =
      (mantissa_type(1) << mantissa_bits) - 1;

  typedef int16_t exponent_type;
  static const exponent_type exponent_max = 308;

  template <typename TExponent>
  static T make_float(T m, TExponent e) {
    if (e > 0) {
      for (uint8_t index = 0; e != 0; index++) {
        if (e & 1)
          m *= positiveBinaryPowerOfTen(index);
        e >>= 1;
      }
    } else {
      e = TExponent(-e);
      for (uint8_t index = 0; e != 0; index++) {
        if (e & 1)
          m *= negativeBinaryPowerOfTen(index);
        e >>= 1;
      }
    }
    return m;
  }

  static T positiveBinaryPowerOfTen(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(  //
        uint32_t, factors,
        ARDUINOJSON_EXPAND18({
            0x40240000, 0x00000000,  // 1e1
            0x40590000, 0x00000000,  // 1e2
            0x40C38800, 0x00000000,  // 1e4
            0x4197D784, 0x00000000,  // 1e8
            0x4341C379, 0x37E08000,  // 1e16
            0x4693B8B5, 0xB5056E17,  // 1e32
            0x4D384F03, 0xE93FF9F5,  // 1e64
            0x5A827748, 0xF9301D32,  // 1e128
            0x75154FDD, 0x7F73BF3C   // 1e256
        }));
    return forge(
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index),
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index + 1));
  }

  static T negativeBinaryPowerOfTen(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(  //
        uint32_t, factors,
        ARDUINOJSON_EXPAND18({
            0x3FB99999, 0x9999999A,  // 1e-1
            0x3F847AE1, 0x47AE147B,  // 1e-2
            0x3F1A36E2, 0xEB1C432D,  // 1e-4
            0x3E45798E, 0xE2308C3A,  // 1e-8
            0x3C9CD2B2, 0x97D889BC,  // 1e-16
            0x3949F623, 0xD5A8A733,  // 1e-32
            0x32A50FFD, 0x44F4A73D,  // 1e-64
            0x255BBA08, 0xCF8C979D,  // 1e-128
            0x0AC80628, 0x64AC6F43   // 1e-256
        }));
    return forge(
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index),
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index + 1));
  }

  static T negativeBinaryPowerOfTenPlusOne(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(  //
        uint32_t, factors,
        ARDUINOJSON_EXPAND18({
            0x3FF00000, 0x00000000,  // 1e0
            0x3FB99999, 0x9999999A,  // 1e-1
            0x3F50624D, 0xD2F1A9FC,  // 1e-3
            0x3E7AD7F2, 0x9ABCAF48,  // 1e-7
            0x3CD203AF, 0x9EE75616,  // 1e-15
            0x398039D6, 0x65896880,  // 1e-31
            0x32DA53FC, 0x9631D10D,  // 1e-63
            0x25915445, 0x81B7DEC2,  // 1e-127
            0x0AFE07B2, 0x7DD78B14   // 1e-255
        }));
    return forge(
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index),
        ARDUINOJSON_READ_STATIC_ARRAY(uint32_t, factors, 2 * index + 1));
  }

  static T nan() {
    return forge(0x7ff80000, 0x00000000);
  }

  static T inf() {
    return forge(0x7ff00000, 0x00000000);
  }

  static T highest() {
    return forge(0x7FEFFFFF, 0xFFFFFFFF);
  }

  static T lowest() {
    return forge(0xFFEFFFFF, 0xFFFFFFFF);
  }

  // constructs a double floating point values from its binary representation
  // we use this function to workaround platforms with single precision literals
  // (for example, when -fsingle-precision-constant is passed to GCC)
  static T forge(uint32_t msb, uint32_t lsb) {
    return alias_cast<T>((uint64_t(msb) << 32) | lsb);
  }
};

template <typename T>
struct FloatTraits<T, 4 /*32bits*/> {
  typedef uint32_t mantissa_type;
  static const short mantissa_bits = 23;
  static const mantissa_type mantissa_max =
      (mantissa_type(1) << mantissa_bits) - 1;

  typedef int8_t exponent_type;
  static const exponent_type exponent_max = 38;

  template <typename TExponent>
  static T make_float(T m, TExponent e) {
    if (e > 0) {
      for (uint8_t index = 0; e != 0; index++) {
        if (e & 1)
          m *= positiveBinaryPowerOfTen(index);
        e >>= 1;
      }
    } else {
      e = -e;
      for (uint8_t index = 0; e != 0; index++) {
        if (e & 1)
          m *= negativeBinaryPowerOfTen(index);
        e >>= 1;
      }
    }
    return m;
  }

  static T positiveBinaryPowerOfTen(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(
        T, factors,
        ARDUINOJSON_EXPAND6({1e1f, 1e2f, 1e4f, 1e8f, 1e16f, 1e32f}));
    return ARDUINOJSON_READ_STATIC_ARRAY(T, factors, index);
  }

  static T negativeBinaryPowerOfTen(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(
        T, factors,
        ARDUINOJSON_EXPAND6({1e-1f, 1e-2f, 1e-4f, 1e-8f, 1e-16f, 1e-32f}));
    return ARDUINOJSON_READ_STATIC_ARRAY(T, factors, index);
  }

  static T negativeBinaryPowerOfTenPlusOne(int index) {
    ARDUINOJSON_DEFINE_STATIC_ARRAY(
        T, factors,
        ARDUINOJSON_EXPAND6({1e0f, 1e-1f, 1e-3f, 1e-7f, 1e-15f, 1e-31f}));
    return ARDUINOJSON_READ_STATIC_ARRAY(T, factors, index);
  }

  static T forge(uint32_t bits) {
    return alias_cast<T>(bits);
  }

  static T nan() {
    return forge(0x7fc00000);
  }

  static T inf() {
    return forge(0x7f800000);
  }

  static T highest() {
    return forge(0x7f7fffff);
  }

  static T lowest() {
    return forge(0xFf7fffff);
  }
};
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/StringStorage/StringStorage.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/StringStorage/StringCopier.hpp>
#include <ArduinoJson/StringStorage/StringMover.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename TInput>
StringCopier makeStringStorage(TInput&, MemoryPool& pool) {
  return StringCopier(pool);
}

template <typename TChar>
StringMover makeStringStorage(
    TChar* input, MemoryPool&,
    typename enable_if<!is_const<TChar>::value>::type* = 0) {
  return StringMover(reinterpret_cast<char*>(input));
}
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/MsgPackDeserializer/misc.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("deserializeMsgPack() returns EmptyInput") {
  StaticJsonDocument<100> doc;

  SECTION("from sized buffer") {
    DeserializationError err = deserializeMsgPack(doc, "", 0);

    REQUIRE(err == DeserializationError::EmptyInput);
  }

  SECTION("from stream") {
    std::istringstream input("");

    DeserializationError err = deserializeMsgPack(doc, input);

    REQUIRE(err == DeserializationError::EmptyInput);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/FastLED/platforms.cpp<|end_filename|>
#define FASTLED_INTERNAL


// Interrupt handlers cannot be defined in the header.
// They must be defined as C functions, or they won't
// be found (due to name mangling), and thus won't
// override any default weak definition.
#if defined(NRF52_SERIES)

    #include "platforms/arm/nrf52/led_sysdefs_arm_nrf52.h"
    #include "platforms/arm/nrf52/arbiter_nrf52.h"

    uint32_t isrCount;

    #ifdef __cplusplus
        extern "C" {
    #endif
            // NOTE: Update platforms.cpp in root of FastLED library if this changes        
            #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE0)
                void PWM0_IRQHandler(void) { isrCount++; PWM_Arbiter<0>::isr_handler(); }
            #endif
            #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE1)
                void PWM1_IRQHandler(void) { isrCount++; PWM_Arbiter<1>::isr_handler(); }
            #endif
            #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE2)
                void PWM2_IRQHandler(void) { isrCount++; PWM_Arbiter<2>::isr_handler(); }
            #endif
            #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE3)
                void PWM3_IRQHandler(void) { isrCount++; PWM_Arbiter<3>::isr_handler(); }
            #endif
    #ifdef __cplusplus
        }
    #endif

#endif // defined(NRF52_SERIES)



// FASTLED_NAMESPACE_BEGIN
// FASTLED_NAMESPACE_END


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Misc/Utf16.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson/Json/Utf16.hpp>
#include <catch.hpp>

using namespace ARDUINOJSON_NAMESPACE;

static void testUtf16Codepoint(uint16_t codeunit, uint32_t expectedCodepoint) {
  Utf16::Codepoint cp;
  REQUIRE(cp.append(codeunit) == true);
  REQUIRE(cp.value() == expectedCodepoint);
}

static void testUtf16Codepoint(uint16_t codeunit1, uint16_t codeunit2,
                               uint32_t expectedCodepoint) {
  Utf16::Codepoint cp;
  REQUIRE(cp.append(codeunit1) == false);
  REQUIRE(cp.append(codeunit2) == true);
  REQUIRE(cp.value() == expectedCodepoint);
}

TEST_CASE("Utf16::Codepoint()") {
  SECTION("U+0000") {
    testUtf16Codepoint(0x0000, 0x000000);
  }

  SECTION("U+0001") {
    testUtf16Codepoint(0x0001, 0x000001);
  }

  SECTION("U+D7FF") {
    testUtf16Codepoint(0xD7FF, 0x00D7FF);
  }

  SECTION("U+E000") {
    testUtf16Codepoint(0xE000, 0x00E000);
  }

  SECTION("U+FFFF") {
    testUtf16Codepoint(0xFFFF, 0x00FFFF);
  }

  SECTION("U+010000") {
    testUtf16Codepoint(0xD800, 0xDC00, 0x010000);
  }

  SECTION("U+010001") {
    testUtf16Codepoint(0xD800, 0xDC01, 0x010001);
  }

  SECTION("U+0103FF") {
    testUtf16Codepoint(0xD800, 0xDFFF, 0x0103FF);
  }

  SECTION("U+010400") {
    testUtf16Codepoint(0xD801, 0xDC00, 0x010400);
  }

  SECTION("U+010400") {
    testUtf16Codepoint(0xDBFF, 0xDC00, 0x10FC00);
  }

  SECTION("U+10FFFF") {
    testUtf16Codepoint(0xDBFF, 0xDFFF, 0x10FFFF);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Polyfills/type_traits/is_class.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include "declval.hpp"

namespace ARDUINOJSON_NAMESPACE {

template <typename T>
struct is_class {
 protected:  // <- to avoid GCC's "all member functions in class are private"
  typedef char Yes[1];
  typedef char No[2];

  template <typename U>
  static Yes &probe(void (U::*)(void));
  template <typename>
  static No &probe(...);

 public:
  static const bool value = sizeof(probe<T>(0)) == sizeof(Yes);
};

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Misc/weird_strcmp.hpp<|end_filename|>
#include <ArduinoJson/Namespace.hpp>

// Issue #1198: strcmp() implementation that returns a value larger than 8-bit

namespace ARDUINOJSON_NAMESPACE {
int strcmp(const char* a, const char* b) {
  int result = ::strcmp(a, b);
  if (result > 0)
    return 2147483647;
  if (result < 0)
    return -214748364;
  return 0;
}

int strncmp(const char* a, const char* b, size_t n) {
  int result = ::strncmp(a, b, n);
  if (result > 0)
    return 2147483647;
  if (result < 0)
    return -214748364;
  return 0;
}
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonDocument/compare.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("DynamicJsonDocument::operator==(const DynamicJsonDocument&)") {
  DynamicJsonDocument doc1(4096);
  DynamicJsonDocument doc2(4096);

  SECTION("Empty") {
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }

  SECTION("With same object") {
    doc1["hello"] = "world";
    doc2["hello"] = "world";
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }
  SECTION("With different object") {
    doc1["hello"] = "world";
    doc2["world"] = "hello";
    REQUIRE_FALSE(doc1 == doc2);
    REQUIRE(doc1 != doc2);
  }
}

TEST_CASE("DynamicJsonDocument::operator==(const StaticJsonDocument&)") {
  DynamicJsonDocument doc1(4096);
  StaticJsonDocument<256> doc2;

  SECTION("Empty") {
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }

  SECTION("With same object") {
    doc1["hello"] = "world";
    doc2["hello"] = "world";
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }

  SECTION("With different object") {
    doc1["hello"] = "world";
    doc2["world"] = "hello";
    REQUIRE_FALSE(doc1 == doc2);
    REQUIRE(doc1 != doc2);
  }
}

TEST_CASE("StaticJsonDocument::operator==(const DynamicJsonDocument&)") {
  StaticJsonDocument<256> doc1;
  DynamicJsonDocument doc2(4096);

  SECTION("Empty") {
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }

  SECTION("With same object") {
    doc1["hello"] = "world";
    doc2["hello"] = "world";
    REQUIRE(doc1 == doc2);
    REQUIRE_FALSE(doc1 != doc2);
  }

  SECTION("With different object") {
    doc1["hello"] = "world";
    doc2["world"] = "hello";
    REQUIRE_FALSE(doc1 == doc2);
    REQUIRE(doc1 != doc2);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Serialization/serialize.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Serialization/Writer.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <template <typename> class TSerializer, typename TSource,
          typename TWriter>
size_t doSerialize(const TSource &source, TWriter writer) {
  TSerializer<TWriter> serializer(writer);
  return source.accept(serializer);
}

template <template <typename> class TSerializer, typename TSource,
          typename TDestination>
size_t serialize(const TSource &source, TDestination &destination) {
  Writer<TDestination> writer(destination);
  return doSerialize<TSerializer>(source, writer);
}

template <template <typename> class TSerializer, typename TSource>
typename enable_if<!TSerializer<StaticStringWriter>::producesText, size_t>::type
serialize(const TSource &source, void *buffer, size_t bufferSize) {
  StaticStringWriter writer(reinterpret_cast<char *>(buffer), bufferSize);
  return doSerialize<TSerializer>(source, writer);
}

template <template <typename> class TSerializer, typename TSource>
typename enable_if<TSerializer<StaticStringWriter>::producesText, size_t>::type
serialize(const TSource &source, void *buffer, size_t bufferSize) {
  StaticStringWriter writer(reinterpret_cast<char *>(buffer), bufferSize);
  size_t n = doSerialize<TSerializer>(source, writer);
  // add null-terminator for text output (not counted in the size)
  if (n < bufferSize)
    reinterpret_cast<char *>(buffer)[n] = 0;
  return n;
}

template <template <typename> class TSerializer, typename TSource,
          typename TChar, size_t N>
#if defined _MSC_VER && _MSC_VER < 1900
typename enable_if<sizeof(remove_reference<TChar>::type) == 1, size_t>::type
#else
typename enable_if<sizeof(TChar) == 1, size_t>::type
#endif
serialize(const TSource &source, TChar (&buffer)[N]) {
  return serialize<TSerializer>(source, buffer, N);
}

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/IntegrationTests/gbathree.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("Gbathree") {
  DynamicJsonDocument doc(4096);

  DeserializationError error = deserializeJson(
      doc,
      "{\"protocol_name\":\"fluorescence\",\"repeats\":1,\"wait\":0,"
      "\"averages\":1,\"measurements\":3,\"meas2_light\":15,\"meas1_"
      "baseline\":0,\"act_light\":20,\"pulsesize\":25,\"pulsedistance\":"
      "10000,\"actintensity1\":50,\"actintensity2\":255,\"measintensity\":"
      "255,\"calintensity\":255,\"pulses\":[50,50,50],\"act\":[2,1,2,2],"
      "\"red\":[2,2,2,2],\"detectors\":[[34,34,34,34],[34,34,34,34],[34,"
      "34,34,34],[34,34,34,34]],\"alta\":[2,2,2,2],\"altb\":[2,2,2,2],"
      "\"measlights\":[[15,15,15,15],[15,15,15,15],[15,15,15,15],[15,15,"
      "15,15]],\"measlights2\":[[15,15,15,15],[15,15,15,15],[15,15,15,15],"
      "[15,15,15,15]],\"altc\":[2,2,2,2],\"altd\":[2,2,2,2]}");
  JsonObject root = doc.as<JsonObject>();

  SECTION("Success") {
    REQUIRE(error == DeserializationError::Ok);
  }

  SECTION("ProtocolName") {
    REQUIRE("fluorescence" == root["protocol_name"]);
  }

  SECTION("Repeats") {
    REQUIRE(1 == root["repeats"]);
  }

  SECTION("Wait") {
    REQUIRE(0 == root["wait"]);
  }

  SECTION("Measurements") {
    REQUIRE(3 == root["measurements"]);
  }

  SECTION("Meas2_Light") {
    REQUIRE(15 == root["meas2_light"]);
  }

  SECTION("Meas1_Baseline") {
    REQUIRE(0 == root["meas1_baseline"]);
  }

  SECTION("Act_Light") {
    REQUIRE(20 == root["act_light"]);
  }

  SECTION("Pulsesize") {
    REQUIRE(25 == root["pulsesize"]);
  }

  SECTION("Pulsedistance") {
    REQUIRE(10000 == root["pulsedistance"]);
  }

  SECTION("Actintensity1") {
    REQUIRE(50 == root["actintensity1"]);
  }

  SECTION("Actintensity2") {
    REQUIRE(255 == root["actintensity2"]);
  }

  SECTION("Measintensity") {
    REQUIRE(255 == root["measintensity"]);
  }

  SECTION("Calintensity") {
    REQUIRE(255 == root["calintensity"]);
  }

  SECTION("Pulses") {
    // "pulses":[50,50,50]

    JsonArray array = root["pulses"];
    REQUIRE(array.isNull() == false);

    REQUIRE(3 == array.size());

    for (size_t i = 0; i < 3; i++) {
      REQUIRE(50 == array[i]);
    }
  }

  SECTION("Act") {
    // "act":[2,1,2,2]

    JsonArray array = root["act"];
    REQUIRE(array.isNull() == false);

    REQUIRE(4 == array.size());
    REQUIRE(2 == array[0]);
    REQUIRE(1 == array[1]);
    REQUIRE(2 == array[2]);
    REQUIRE(2 == array[3]);
  }

  SECTION("Detectors") {
    // "detectors":[[34,34,34,34],[34,34,34,34],[34,34,34,34],[34,34,34,34]]

    JsonArray array = root["detectors"];
    REQUIRE(array.isNull() == false);
    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      JsonArray nestedArray = array[i];
      REQUIRE(4 == nestedArray.size());

      for (size_t j = 0; j < 4; j++) {
        REQUIRE(34 == nestedArray[j]);
      }
    }
  }

  SECTION("Alta") {
    // alta:[2,2,2,2]

    JsonArray array = root["alta"];
    REQUIRE(array.isNull() == false);

    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      REQUIRE(2 == array[i]);
    }
  }

  SECTION("Altb") {
    // altb:[2,2,2,2]

    JsonArray array = root["altb"];
    REQUIRE(array.isNull() == false);

    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      REQUIRE(2 == array[i]);
    }
  }

  SECTION("Measlights") {
    // "measlights":[[15,15,15,15],[15,15,15,15],[15,15,15,15],[15,15,15,15]]

    JsonArray array = root["measlights"];
    REQUIRE(array.isNull() == false);
    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      JsonArray nestedArray = array[i];

      REQUIRE(4 == nestedArray.size());

      for (size_t j = 0; j < 4; j++) {
        REQUIRE(15 == nestedArray[j]);
      }
    }
  }

  SECTION("Measlights2") {
    // "measlights2":[[15,15,15,15],[15,15,15,15],[15,15,15,15],[15,15,15,15]]

    JsonArray array = root["measlights2"];
    REQUIRE(array.isNull() == false);
    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      JsonArray nestedArray = array[i];
      REQUIRE(4 == nestedArray.size());

      for (size_t j = 0; j < 4; j++) {
        REQUIRE(15 == nestedArray[j]);
      }
    }
  }

  SECTION("Altc") {
    // altc:[2,2,2,2]

    JsonArray array = root["altc"];
    REQUIRE(array.isNull() == false);

    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      REQUIRE(2 == array[i]);
    }
  }

  SECTION("Altd") {
    // altd:[2,2,2,2]

    JsonArray array = root["altd"];
    REQUIRE(array.isNull() == false);

    REQUIRE(4 == array.size());

    for (size_t i = 0; i < 4; i++) {
      REQUIRE(2 == array[i]);
    }
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/OssmUi/include/OssmUi.h<|end_filename|>

#ifndef OSSM_UI_H
#define OSSM_UI_H

#include <Arduino.h>
#include <Wire.h>

#include "OLEDDisplayUi.h"
#include "SSD1306Wire.h"

class OssmUi
{
   public:
    OssmUi(uint8_t address, int sda, int scl);

    void Setup();

    /**
     * @brief Set the FPS
     *
     * The ESP is capable of rendering 60fps in 80Mhz mode
     * but that won't give you much time for anything else
     * run it in 160Mhz mode or just set it to 30 fps
     *
     * @param target_fps
     */
    void SetTargetFps(uint8_t target_fps);

    void ResetState();

    void SetFrames(OverlayCallback *overlays, size_t overlays_count, FrameCallback *frames, size_t frames_count);

    void SetActivitySymbols(const uint8_t *active, const uint8_t *inactive);

    void UpdateState(const int speed_percentage, const int encoder_position);

    void UpdateMessage(String message_in);

    void ShowFrame(uint8_t frame)
    {
        m_ui.switchToFrame(frame);
    }

    void NextFrame()
    {
        m_ui.nextFrame();
    }

    void UpdateScreen();

    void UpdateOnly();

    bool DisplayIsConnected() const
    {
        return m_connected;
    }

   private:

    SSD1306Wire m_display;
    OLEDDisplayUi m_ui;
    uint8_t m_address;
    uint32_t m_check_connectivity_interval;
    bool m_connected;
    uint32_t m_last_update_time;

};

#endif


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Polyfills/pgmspace_generic.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Namespace.hpp>
#include <ArduinoJson/Polyfills/type_traits.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename T>
typename enable_if<is_pointer<T>::value, T>::type pgm_read(const void* p) {
  return reinterpret_cast<T>(pgm_read_ptr(p));
}

template <typename T>
typename enable_if<is_floating_point<T>::value &&
                       sizeof(T) == sizeof(float),  // on AVR sizeof(double) ==
                                                    // sizeof(float)
                   T>::type
pgm_read(const void* p) {
  return pgm_read_float(p);
}

template <typename T>
typename enable_if<is_same<T, uint32_t>::value, T>::type pgm_read(
    const void* p) {
  return pgm_read_dword(p);
}

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Polyfills/type_traits/is_same.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include "integral_constant.hpp"

namespace ARDUINOJSON_NAMESPACE {

// A meta-function that returns true if types T and U are the same.
template <typename T, typename U>
struct is_same : false_type {};

template <typename T>
struct is_same<T, T> : true_type {};
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonArray/subscript.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <stdint.h>
#include <catch.hpp>

TEST_CASE("JsonArray::operator[]") {
  DynamicJsonDocument doc(4096);
  JsonArray array = doc.to<JsonArray>();

  SECTION("Pad with null") {
    array[2] = 2;
    array[5] = 5;
    REQUIRE(array.size() == 6);
    REQUIRE(array[0].isNull() == true);
    REQUIRE(array[1].isNull() == true);
    REQUIRE(array[2].isNull() == false);
    REQUIRE(array[3].isNull() == true);
    REQUIRE(array[4].isNull() == true);
    REQUIRE(array[5].isNull() == false);
    REQUIRE(array[2] == 2);
    REQUIRE(array[5] == 5);
  }

  SECTION("int") {
    array[0] = 123;
    REQUIRE(123 == array[0].as<int>());
    REQUIRE(true == array[0].is<int>());
    REQUIRE(false == array[0].is<bool>());
  }

#if ARDUINOJSON_USE_LONG_LONG
  SECTION("long long") {
    array[0] = 9223372036854775807;
    REQUIRE(9223372036854775807 == array[0].as<int64_t>());
    REQUIRE(true == array[0].is<int64_t>());
    REQUIRE(false == array[0].is<int32_t>());
    REQUIRE(false == array[0].is<bool>());
  }
#endif

  SECTION("double") {
    array[0] = 123.45;
    REQUIRE(123.45 == array[0].as<double>());
    REQUIRE(true == array[0].is<double>());
    REQUIRE(false == array[0].is<int>());
  }

  SECTION("bool") {
    array[0] = true;
    REQUIRE(true == array[0].as<bool>());
    REQUIRE(true == array[0].is<bool>());
    REQUIRE(false == array[0].is<int>());
  }

  SECTION("const char*") {
    const char* str = "hello";

    array[0] = str;
    REQUIRE(str == array[0].as<const char*>());
    REQUIRE(true == array[0].is<const char*>());
    REQUIRE(false == array[0].is<int>());
  }

  SECTION("nested array") {
    DynamicJsonDocument doc2(4096);
    JsonArray arr2 = doc2.to<JsonArray>();

    array[0] = arr2;

    REQUIRE(arr2 == array[0].as<JsonArray>());
    REQUIRE(true == array[0].is<JsonArray>());
    REQUIRE(false == array[0].is<int>());
  }

  SECTION("nested object") {
    DynamicJsonDocument doc2(4096);
    JsonObject obj = doc2.to<JsonObject>();

    array[0] = obj;

    REQUIRE(obj == array[0].as<JsonObject>());
    REQUIRE(true == array[0].is<JsonObject>());
    REQUIRE(false == array[0].is<int>());
  }

  SECTION("array subscript") {
    DynamicJsonDocument doc2(4096);
    JsonArray arr2 = doc2.to<JsonArray>();
    const char* str = "hello";

    arr2.add(str);

    array[0] = arr2[0];

    REQUIRE(str == array[0]);
  }

  SECTION("object subscript") {
    const char* str = "hello";
    DynamicJsonDocument doc2(4096);
    JsonObject obj = doc2.to<JsonObject>();

    obj["x"] = str;

    array[0] = obj["x"];

    REQUIRE(str == array[0]);
  }

  SECTION("should not duplicate const char*") {
    array[0] = "world";
    const size_t expectedSize = JSON_ARRAY_SIZE(1);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate char*") {
    array[0] = const_cast<char*>("world");
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(5);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate std::string") {
    array[0] = std::string("world");
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(5);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("array[0].to<JsonObject>()") {
    JsonObject obj = array[0].to<JsonObject>();
    REQUIRE(obj.isNull() == false);
  }

#ifdef HAS_VARIABLE_LENGTH_ARRAY
  SECTION("set(VLA)") {
    int i = 16;
    char vla[i];
    strcpy(vla, "world");

    array.add("hello");
    array[0].set(vla);

    REQUIRE(std::string("world") == array[0]);
  }

  SECTION("operator=(VLA)") {
    int i = 16;
    char vla[i];
    strcpy(vla, "world");

    array.add("hello");
    array[0] = vla;

    REQUIRE(std::string("world") == array[0]);
  }
#endif
}

TEST_CASE("JsonArrayConst::operator[]") {
  DynamicJsonDocument doc(4096);
  JsonArray array = doc.to<JsonArray>();
  array.add(0);

  SECTION("int") {
    array[0] = 123;
    JsonArrayConst carr = array;

    REQUIRE(123 == carr[0].as<int>());
    REQUIRE(true == carr[0].is<int>());
    REQUIRE(false == carr[0].is<bool>());
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonArray/add.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("JsonArray::add()") {
  DynamicJsonDocument doc(4096);
  JsonArray array = doc.to<JsonArray>();

  SECTION("int") {
    array.add(123);
    REQUIRE(123 == array[0].as<int>());
    REQUIRE(array[0].is<int>());
    REQUIRE(array[0].is<double>());
  }

  SECTION("double") {
    array.add(123.45);
    REQUIRE(123.45 == array[0].as<double>());
    REQUIRE(array[0].is<double>());
    REQUIRE_FALSE(array[0].is<bool>());
  }

  SECTION("bool") {
    array.add(true);
    REQUIRE(true == array[0].as<bool>());
    REQUIRE(array[0].is<bool>());
    REQUIRE_FALSE(array[0].is<int>());
  }

  SECTION("const char*") {
    const char* str = "hello";
    array.add(str);
    REQUIRE(str == array[0].as<std::string>());
    REQUIRE(array[0].is<const char*>());
    REQUIRE_FALSE(array[0].is<int>());
  }

#ifdef HAS_VARIABLE_LENGTH_ARRAY
  SECTION("vla") {
    int i = 16;
    char vla[i];
    strcpy(vla, "world");

    array.add(vla);

    REQUIRE(std::string("world") == array[0]);
  }
#endif

  SECTION("nested array") {
    DynamicJsonDocument doc2(4096);
    JsonArray arr = doc2.to<JsonArray>();

    array.add(arr);

    REQUIRE(arr == array[0].as<JsonArray>());
    REQUIRE(array[0].is<JsonArray>());
    REQUIRE_FALSE(array[0].is<int>());
  }

  SECTION("nested object") {
    DynamicJsonDocument doc2(4096);
    JsonObject obj = doc2.to<JsonObject>();

    array.add(obj);

    REQUIRE(obj == array[0].as<JsonObject>());
    REQUIRE(array[0].is<JsonObject>());
    REQUIRE_FALSE(array[0].is<int>());
  }

  SECTION("array subscript") {
    const char* str = "hello";
    DynamicJsonDocument doc2(4096);
    JsonArray arr = doc2.to<JsonArray>();
    arr.add(str);

    array.add(arr[0]);

    REQUIRE(str == array[0]);
  }

  SECTION("object subscript") {
    const char* str = "hello";
    DynamicJsonDocument doc2(4096);
    JsonObject obj = doc2.to<JsonObject>();
    obj["x"] = str;

    array.add(obj["x"]);

    REQUIRE(str == array[0]);
  }

  SECTION("should not duplicate const char*") {
    array.add("world");
    const size_t expectedSize = JSON_ARRAY_SIZE(1);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate char*") {
    array.add(const_cast<char*>("world"));
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(5);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate std::string") {
    array.add(std::string("world"));
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(5);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should not duplicate serialized(const char*)") {
    array.add(serialized("{}"));
    const size_t expectedSize = JSON_ARRAY_SIZE(1);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate serialized(char*)") {
    array.add(serialized(const_cast<char*>("{}")));
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(2);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate serialized(std::string)") {
    array.add(serialized(std::string("{}")));
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(2);
    REQUIRE(expectedSize == doc.memoryUsage());
  }

  SECTION("should duplicate serialized(std::string)") {
    array.add(serialized(std::string("\0XX", 3)));
    const size_t expectedSize = JSON_ARRAY_SIZE(1) + JSON_STRING_SIZE(3);
    REQUIRE(expectedSize == doc.memoryUsage());
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/FailingBuilds/Issue1189.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>

// a function should not be able to get a JsonDocument by value
void f(JsonDocument) {}

int main() {
  DynamicJsonDocument doc(1024);
  f(doc);
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Json/PrettyJsonSerializer.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Configuration.hpp>
#include <ArduinoJson/Json/JsonSerializer.hpp>
#include <ArduinoJson/Serialization/measure.hpp>
#include <ArduinoJson/Serialization/serialize.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename TWriter>
class PrettyJsonSerializer : public JsonSerializer<TWriter> {
  typedef JsonSerializer<TWriter> base;

 public:
  PrettyJsonSerializer(TWriter writer) : base(writer), _nesting(0) {}

  size_t visitArray(const CollectionData &array) {
    VariantSlot *slot = array.head();
    if (slot) {
      base::write("[\r\n");
      _nesting++;
      while (slot != 0) {
        indent();
        slot->data()->accept(*this);

        slot = slot->next();
        base::write(slot ? ",\r\n" : "\r\n");
      }
      _nesting--;
      indent();
      base::write("]");
    } else {
      base::write("[]");
    }
    return this->bytesWritten();
  }

  size_t visitObject(const CollectionData &object) {
    VariantSlot *slot = object.head();
    if (slot) {
      base::write("{\r\n");
      _nesting++;
      while (slot != 0) {
        indent();
        base::visitString(slot->key());
        base::write(": ");
        slot->data()->accept(*this);

        slot = slot->next();
        base::write(slot ? ",\r\n" : "\r\n");
      }
      _nesting--;
      indent();
      base::write("}");
    } else {
      base::write("{}");
    }
    return this->bytesWritten();
  }

 private:
  void indent() {
    for (uint8_t i = 0; i < _nesting; i++) base::write(ARDUINOJSON_TAB);
  }

  uint8_t _nesting;
};

template <typename TSource, typename TDestination>
size_t serializeJsonPretty(const TSource &source, TDestination &destination) {
  return serialize<PrettyJsonSerializer>(source, destination);
}

template <typename TSource>
size_t serializeJsonPretty(const TSource &source, void *buffer,
                           size_t bufferSize) {
  return serialize<PrettyJsonSerializer>(source, buffer, bufferSize);
}

template <typename TSource>
size_t measureJsonPretty(const TSource &source) {
  return measure<PrettyJsonSerializer>(source);
}

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/FastLED/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h<|end_filename|>
#ifndef __FASTPIN_ARM_NRF52_VARIANTS_H
#define __FASTPIN_ARM_NRF52_VARIANTS_H

// use this to determine if found variant or not (avoid multiple boards at once)
#undef __FASTPIN_ARM_NRF52_VARIANT_FOUND

// Adafruit Bluefruit nRF52832 Feather
// From https://www.adafruit.com/package_adafruit_index.json
#if defined (ARDUINO_NRF52832_FEATHER) 
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Adafruit Bluefruit nRF52832 Feather is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM_IDENTITY_P0( 0); // xtal 1
    _DEFPIN_ARM_IDENTITY_P0( 1); // xtal 2
    _DEFPIN_ARM_IDENTITY_P0( 2); // a0
    _DEFPIN_ARM_IDENTITY_P0( 3); // a1
    _DEFPIN_ARM_IDENTITY_P0( 4); // a2
    _DEFPIN_ARM_IDENTITY_P0( 5); // a3
    _DEFPIN_ARM_IDENTITY_P0( 6); // TXD
    _DEFPIN_ARM_IDENTITY_P0( 7); // GPIO #7
    _DEFPIN_ARM_IDENTITY_P0( 8); // RXD
    _DEFPIN_ARM_IDENTITY_P0( 9); // NFC1
    _DEFPIN_ARM_IDENTITY_P0(10); // NFC2
    _DEFPIN_ARM_IDENTITY_P0(11); // GPIO #11
    _DEFPIN_ARM_IDENTITY_P0(12); // SCK
    _DEFPIN_ARM_IDENTITY_P0(13); // MOSI
    _DEFPIN_ARM_IDENTITY_P0(14); // MISO
    _DEFPIN_ARM_IDENTITY_P0(15); // GPIO #15
    _DEFPIN_ARM_IDENTITY_P0(16); // GPIO #16
    _DEFPIN_ARM_IDENTITY_P0(17); // LED #1 (red)
    _DEFPIN_ARM_IDENTITY_P0(18); // SWO
    _DEFPIN_ARM_IDENTITY_P0(19); // LED #2 (blue)
    _DEFPIN_ARM_IDENTITY_P0(20); // DFU
    // _DEFPIN_ARM_IDENTITY_P0(21); // Reset -- not valid to use for FastLED?
    // _DEFPIN_ARM_IDENTITY_P0(22); // Factory Reset -- not vaild to use for FastLED?
    // _DEFPIN_ARM_IDENTITY_P0(23); // N/A
    // _DEFPIN_ARM_IDENTITY_P0(24); // N/A
    _DEFPIN_ARM_IDENTITY_P0(25); // SDA
    _DEFPIN_ARM_IDENTITY_P0(26); // SCL
    _DEFPIN_ARM_IDENTITY_P0(27); // GPIO #27
    _DEFPIN_ARM_IDENTITY_P0(28); // A4
    _DEFPIN_ARM_IDENTITY_P0(29); // A5
    _DEFPIN_ARM_IDENTITY_P0(30); // A6
    _DEFPIN_ARM_IDENTITY_P0(31); // A7
#endif // defined (ARDUINO_NRF52832_FEATHER) 

// Adafruit Bluefruit nRF52840 Feather Express
// From https://www.adafruit.com/package_adafruit_index.json
#if defined (ARDUINO_NRF52840_FEATHER)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif

    #define MAX_PIN (33u) // 34 if wanting to use NFC1 test point

    // Arduino pins 0..7
    _DEFPIN_ARM( 0, 0, 25); // D0  is P0.25 -- UART TX
    //_DEFPIN_ARM( 1, 0, 24); // D1  is P0.24 -- UART RX
    _DEFPIN_ARM( 2, 0, 10); // D2  is P0.10 -- NFC2
    _DEFPIN_ARM( 3, 1, 47); // D3  is P1.15 -- PIN_LED1 (red)
    _DEFPIN_ARM( 4, 1, 42); // D4  is P1.10 -- PIN_LED2 (blue)
    _DEFPIN_ARM( 5, 1, 40); // D5  is P1.08 -- SPI/SS
    _DEFPIN_ARM( 6, 0,  7); // D6  is P0.07
    _DEFPIN_ARM( 7, 1, 34); // D7  is P1.02 -- PIN_DFU (Button)
    
    // Arduino pins 8..15
    _DEFPIN_ARM( 8, 0, 16); // D8  is P0.16 -- PIN_NEOPIXEL
    _DEFPIN_ARM( 9, 0, 26); // D9  is P0.26
    _DEFPIN_ARM(10, 0, 27); // D10 is P0.27
    _DEFPIN_ARM(11, 0,  6); // D11 is P0.06
    _DEFPIN_ARM(12, 0,  8); // D12 is P0.08
    _DEFPIN_ARM(13, 1, 41); // D13 is P1.09
    _DEFPIN_ARM(14, 0,  4); // D14 is P0.04 -- A0
    _DEFPIN_ARM(15, 0,  5); // D15 is P0.05 -- A1

    // Arduino pins 16..23
    _DEFPIN_ARM(16, 0, 30); // D16 is P0.30 -- A2
    _DEFPIN_ARM(17, 0, 28); // D17 is P0.28 -- A3
    _DEFPIN_ARM(18, 0,  2); // D18 is P0.02 -- A4
    _DEFPIN_ARM(19, 0,  3); // D19 is P0.03 -- A5
    //_DEFPIN_ARM(20, 0, 29); // D20 is P0.29 -- A6 -- Connected to battery!
    //_DEFPIN_ARM(21, 0, 31); // D21 is P0.31 -- A7 -- AREF
    _DEFPIN_ARM(22, 0, 12); // D22 is P0.12 -- SDA
    _DEFPIN_ARM(23, 0, 11); // D23 is P0.11 -- SCL

    // Arduino pins 24..31
    _DEFPIN_ARM(24, 0, 15); // D24 is P0.15 -- PIN_SPI_MISO
    _DEFPIN_ARM(25, 0, 13); // D25 is P0.13 -- PIN_SPI_MOSI
    _DEFPIN_ARM(26, 0, 14); // D26 is P0.14 -- PIN_SPI_SCK
    //_DEFPIN_ARM(27, 0, 19); // D27 is P0.19 -- PIN_QSPI_SCK
    //_DEFPIN_ARM(28, 0, 20); // D28 is P0.20 -- PIN_QSPI_CS
    //_DEFPIN_ARM(29, 0, 17); // D29 is P0.17 -- PIN_QSPI_DATA0
    //_DEFPIN_ARM(30, 0, 22); // D30 is P0.22 -- PIN_QSPI_DATA1
    //_DEFPIN_ARM(31, 0, 23); // D31 is P0.23 -- PIN_QSPI_DATA2

    // Arduino pins 32..34
    //_DEFPIN_ARM(32, 0, 21); // D32 is P0.21 -- PIN_QSPI_DATA3
    //_DEFPIN_ARM(33, 0,  9); // D33 is NFC1, only accessible via test point
#endif // defined (ARDUINO_NRF52840_FEATHER)

// Adafruit Bluefruit nRF52840 Metro Express
// From https://www.adafruit.com/package_adafruit_index.json
#if defined (ARDUINO_NRF52840_METRO)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Adafruit Bluefruit nRF52840 Metro Express is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"

    _DEFPIN_ARM( 0, 0, 25); // D0  is P0.25 (UART TX)
    _DEFPIN_ARM( 1, 0, 24); // D1  is P0.24 (UART RX)
    _DEFPIN_ARM( 2, 1, 10); // D2  is P1.10 
    _DEFPIN_ARM( 3, 1,  4); // D3  is P1.04 
    _DEFPIN_ARM( 4, 1, 11); // D4  is P1.11 
    _DEFPIN_ARM( 5, 1, 12); // D5  is P1.12 
    _DEFPIN_ARM( 6, 1, 14); // D6  is P1.14
    _DEFPIN_ARM( 7, 0, 26); // D7  is P0.26
    _DEFPIN_ARM( 8, 0, 27); // D8  is P0.27
    _DEFPIN_ARM( 9, 0, 12); // D9  is P0.12
    _DEFPIN_ARM(10, 0,  6); // D10 is P0.06 
    _DEFPIN_ARM(11, 0,  8); // D11 is P0.08 
    _DEFPIN_ARM(12, 1,  9); // D12 is P1.09 
    _DEFPIN_ARM(13, 0, 14); // D13 is P0.14 
    _DEFPIN_ARM(14, 0,  4); // D14 is P0.04 (A0)
    _DEFPIN_ARM(15, 0,  5); // D15 is P0.05 (A1)
    _DEFPIN_ARM(16, 0, 28); // D16 is P0.28 (A2)
    _DEFPIN_ARM(17, 0, 30); // D17 is P0.30 (A3)
    _DEFPIN_ARM(18, 0,  2); // D18 is P0.02 (A4)
    _DEFPIN_ARM(19, 0,  3); // D19 is P0.03 (A5)
    _DEFPIN_ARM(20, 0, 29); // D20 is P0.29 (A6, battery)
    _DEFPIN_ARM(21, 0, 31); // D21 is P0.31 (A7, ARef)
    _DEFPIN_ARM(22, 0, 15); // D22 is P0.15 (SDA)
    _DEFPIN_ARM(23, 0, 16); // D23 is P0.16 (SCL)
    _DEFPIN_ARM(24, 0, 11); // D24 is P0.11 (SPI MISO)
    _DEFPIN_ARM(25, 1,  8); // D25 is P1.08 (SPI MOSI)
    _DEFPIN_ARM(26, 0,  7); // D26 is P0.07 (SPI SCK )
    //_DEFPIN_ARM(27, 0, 19); // D27 is P0.19 (QSPI CLK   )
    //_DEFPIN_ARM(28, 0, 20); // D28 is P0.20 (QSPI CS    )
    //_DEFPIN_ARM(29, 0, 17); // D29 is P0.17 (QSPI Data 0)
    //_DEFPIN_ARM(30, 0, 23); // D30 is P0.23 (QSPI Data 1)
    //_DEFPIN_ARM(31, 0, 22); // D31 is P0.22 (QSPI Data 2)
    //_DEFPIN_ARM(32, 0, 21); // D32 is P0.21 (QSPI Data 3)
    _DEFPIN_ARM(33, 1, 13); // D33 is P1.13 LED1
    _DEFPIN_ARM(34, 1, 15); // D34 is P1.15 LED2
    _DEFPIN_ARM(35, 0, 13); // D35 is P0.13 NeoPixel
    _DEFPIN_ARM(36, 1,  0); // D36 is P1.02 Switch
    _DEFPIN_ARM(37, 1,  0); // D37 is P1.00 SWO/DFU
    _DEFPIN_ARM(38, 0,  9); // D38 is P0.09 NFC1
    _DEFPIN_ARM(39, 0, 10); // D39 is P0.10 NFC2
#endif // defined (ARDUINO_NRF52840_METRO)

// Adafruit Bluefruit on nRF52840DK PCA10056
// From https://www.adafruit.com/package_adafruit_index.json
#if defined (ARDUINO_NRF52840_PCA10056)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Adafruit Bluefruit on nRF52840DK PCA10056 is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    
    #if defined(USE_ARDUINO_PIN_NUMBERING)
        /* pca10056_schematic_and_pcb.pdf
           Page 3 shows the Arduino Pin to GPIO Px.xx mapping
        */
        _DEFPIN_ARM( 0, 1,  1); // D0  is P1.01 
        _DEFPIN_ARM( 1, 1,  2); // D1  is P1.02 
        _DEFPIN_ARM( 2, 1,  3); // D2  is P1.03
        _DEFPIN_ARM( 3, 1,  4); // D3  is P1.04 
        _DEFPIN_ARM( 4, 1,  5); // D4  is P1.05 
        _DEFPIN_ARM( 5, 1,  6); // D5  is P1.06 
        _DEFPIN_ARM( 6, 1,  7); // D6  is P1.07 (BUTTON1 option)
        _DEFPIN_ARM( 7, 1,  8); // D7  is P1.08 (BUTTON2 option)
        _DEFPIN_ARM( 8, 1, 10); // D8  is P1.10 
        _DEFPIN_ARM( 9, 1, 11); // D9  is P1.11 
        _DEFPIN_ARM(10, 1, 12); // D10 is P1.12 
        _DEFPIN_ARM(11, 1, 13); // D11 is P1.13 
        _DEFPIN_ARM(12, 1, 14); // D12 is P1.14
        _DEFPIN_ARM(13, 1, 15); // D13 is P1.15 
        _DEFPIN_ARM(14, 0,  0); // D14 is P0.00 (if SB4 bridged)
        _DEFPIN_ARM(15, 0,  1); // D15 is P0.01 (if SB3 bridged)
        _DEFPIN_ARM(16, 0,  5); // D16 is P0.05 (aka AIN3, aka UART RTS)
        _DEFPIN_ARM(17, 0,  6); // D17 is P0.06 (UART TxD)
        _DEFPIN_ARM(18, 0,  7); // D18 is P0.07 (UART CTS default)
        _DEFPIN_ARM(19, 0,  8); // D19 is P0.08 (UART RxD)
        _DEFPIN_ARM(20, 0,  9); // D20 is P0.09 (NFC1)
        _DEFPIN_ARM(21, 0, 10); // D21 is P0.10 (NFC2)
        _DEFPIN_ARM(22, 0, 11); // D22 is P0.11 (TRACEDATA2 / BUTTON1 default)
        _DEFPIN_ARM(23, 0, 12); // D23 is P0.12 (TRACEDATA1 / BUTTON2 default)
        _DEFPIN_ARM(24, 0, 13); // D24 is P0.13 (LED1)
        _DEFPIN_ARM(25, 0, 14); // D25 is P0.14 (LED2)
        _DEFPIN_ARM(26, 0, 15); // D26 is P0.15 (LED3)
        _DEFPIN_ARM(27, 0, 16); // D27 is P0.16 (LED4)
        _DEFPIN_ARM(28, 0, 17); // D28 is P0.17 (QSPI !CS , unless SB13 cut)
        // _DEFPIN_ARM(29, 0, 18); // D29 is P0.18 (RESET)
        _DEFPIN_ARM(30, 0, 19); // D30 is P0.19 (QSPI CLK , unless SB11 cut)
        _DEFPIN_ARM(31, 0, 20); // D31 is P0.20 (QSPI DIO0, unless SB12 cut)
        _DEFPIN_ARM(32, 0, 21); // D32 is P0.21 (QSPI DIO1, unless SB14 cut)
        _DEFPIN_ARM(33, 0, 22); // D33 is P0.22 (QSPI DIO2, unless SB15 cut)
        _DEFPIN_ARM(34, 0, 23); // D34 is P0.23 (QSPI DIO3, unless SB10 cut)
        _DEFPIN_ARM(35, 0, 24); // D35 is P0.24 (BUTTON3)
        _DEFPIN_ARM(36, 0, 25); // D36 is P0.25 (BUTTON4)
        _DEFPIN_ARM(37, 1, 00); // D37 is P1.00 (TRACEDATA0 / SWO)
        _DEFPIN_ARM(38, 1, 09); // D38 is P1.09 (TRACEDATA3)
        //_DEFPIN_ARM(??, 0,  2); // D?? is P0.02 (AREF, aka AIN0)
        //_DEFPIN_ARM(??, 0,  3); // D?? is P0.03 (A0,   aka AIN1)
        //_DEFPIN_ARM(??, 0,  4); // D?? is P0.04 (A1,   aka AIN2, aka UART CTS option)
        //_DEFPIN_ARM(??, 0, 28); // D?? is P0.28 (A2,   aka AIN4)
        //_DEFPIN_ARM(??, 0, 29); // D?? is P0.29 (A3,   aka AIN5)
        //_DEFPIN_ARM(??, 0, 30); // D?? is P0.30 (A4,   aka AIN6)
        //_DEFPIN_ARM(??, 0, 31); // D?? is P0.31 (A5,   aka AIN7)

    #else
        /* 48 pins, defined using natural mapping in Adafruit's variant.cpp (!) */
        _DEFPIN_ARM_IDENTITY_P0( 0); // P0.00 (XL1 .. ensure SB4 bridged, SB2 cut)
        _DEFPIN_ARM_IDENTITY_P0( 1); // P0.01 (XL2 .. ensure SB3 bridged, SB1 cut)
        _DEFPIN_ARM_IDENTITY_P0( 2); // P0.02 (AIN0)
        _DEFPIN_ARM_IDENTITY_P0( 3); // P0.03 (AIN1)
        _DEFPIN_ARM_IDENTITY_P0( 4); // P0.04 (AIN2 / UART CTS option)
        _DEFPIN_ARM_IDENTITY_P0( 5); // P0.05 (AIN3 / UART RTS)
        _DEFPIN_ARM_IDENTITY_P0( 6); // P0.06 (UART TxD)
        _DEFPIN_ARM_IDENTITY_P0( 7); // P0.07 (TRACECLK / UART CTS default)
        _DEFPIN_ARM_IDENTITY_P0( 8); // P0.08 (UART RxD)
        _DEFPIN_ARM_IDENTITY_P0( 9); // P0.09 (NFC1)
        _DEFPIN_ARM_IDENTITY_P0(10); // P0.10 (NFC2)
        _DEFPIN_ARM_IDENTITY_P0(11); // P0.11 (TRACEDATA2 / BUTTON1 default)
        _DEFPIN_ARM_IDENTITY_P0(12); // P0.12 (TRACEDATA1 / BUTTON2 default)
        _DEFPIN_ARM_IDENTITY_P0(13); // P0.13 (LED1)
        _DEFPIN_ARM_IDENTITY_P0(14); // P0.14 (LED2)
        _DEFPIN_ARM_IDENTITY_P0(15); // P0.15 (LED3)
        _DEFPIN_ARM_IDENTITY_P0(16); // P0.16 (LED4)
        //_DEFPIN_ARM_IDENTITY_P0(17); // P0.17 (QSPI !CS )
        //_DEFPIN_ARM_IDENTITY_P0(18); // P0.18 (RESET)
        //_DEFPIN_ARM_IDENTITY_P0(19); // P0.19 (QSPI CLK )
        //_DEFPIN_ARM_IDENTITY_P0(20); // P0.20 (QSPI DIO0)
        //_DEFPIN_ARM_IDENTITY_P0(21); // P0.21 (QSPI DIO1)
        //_DEFPIN_ARM_IDENTITY_P0(22); // P0.22 (QSPI DIO2)
        //_DEFPIN_ARM_IDENTITY_P0(23); // P0.23 (QSPI DIO3)
        _DEFPIN_ARM_IDENTITY_P0(24); // P0.24 (BUTTON3)
        _DEFPIN_ARM_IDENTITY_P0(25); // P0.25 (BUTTON4)
        _DEFPIN_ARM_IDENTITY_P0(26); // P0.26
        _DEFPIN_ARM_IDENTITY_P0(27); // P0.27
        _DEFPIN_ARM_IDENTITY_P0(28); // P0.28 (AIN4)
        _DEFPIN_ARM_IDENTITY_P0(29); // P0.29 (AIN5)
        _DEFPIN_ARM_IDENTITY_P0(30); // P0.30 (AIN6)
        _DEFPIN_ARM_IDENTITY_P0(31); // P0.31 (AIN7)
        _DEFPIN_ARM_IDENTITY_P0(32); // P1.00 (SWO / TRACEDATA0)
        _DEFPIN_ARM_IDENTITY_P0(33); // P1.01 
        _DEFPIN_ARM_IDENTITY_P0(34); // P1.02
        _DEFPIN_ARM_IDENTITY_P0(35); // P1.03
        _DEFPIN_ARM_IDENTITY_P0(36); // P1.04
        _DEFPIN_ARM_IDENTITY_P0(37); // P1.05
        _DEFPIN_ARM_IDENTITY_P0(38); // P1.06
        _DEFPIN_ARM_IDENTITY_P0(39); // P1.07 (BUTTON1 option)
        _DEFPIN_ARM_IDENTITY_P0(40); // P1.08 (BUTTON2 option)
        _DEFPIN_ARM_IDENTITY_P0(41); // P1.09 (TRACEDATA3)
        _DEFPIN_ARM_IDENTITY_P0(42); // P1.10
        _DEFPIN_ARM_IDENTITY_P0(43); // P1.11
        _DEFPIN_ARM_IDENTITY_P0(44); // P1.12
        _DEFPIN_ARM_IDENTITY_P0(45); // P1.13
        _DEFPIN_ARM_IDENTITY_P0(46); // P1.14
        _DEFPIN_ARM_IDENTITY_P0(47); // P1.15
    #endif
#endif // defined (ARDUINO_NRF52840_PCA10056)

// Electronut labs bluey
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/bluey/variant.cpp
#if defined(ARDUINO_ELECTRONUT_BLUEY)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Electronut labs bluey is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"

    _DEFPIN_ARM( 0, 0, 26); // D0  is P0.26
    _DEFPIN_ARM( 1, 0, 27); // D1  is P0.27
    _DEFPIN_ARM( 2, 0, 22); // D2  is P0.22 (SPI SS  )
    _DEFPIN_ARM( 3, 0, 23); // D3  is P0.23 (SPI MOSI)
    _DEFPIN_ARM( 4, 0, 24); // D4  is P0.24 (SPI MISO, also A3)
    _DEFPIN_ARM( 5, 0, 25); // D5  is P0.25 (SPI SCK )
    _DEFPIN_ARM( 6, 0, 16); // D6  is P0.16 (Button)
    _DEFPIN_ARM( 7, 0, 19); // D7  is P0.19 (R)
    _DEFPIN_ARM( 8, 0, 18); // D8  is P0.18 (G)
    _DEFPIN_ARM( 9, 0, 17); // D9  is P0.17 (B)
    _DEFPIN_ARM(10, 0, 11); // D10 is P0.11 (SCL)
    _DEFPIN_ARM(11, 0, 12); // D11 is P0.12 (DRDYn)
    _DEFPIN_ARM(12, 0, 13); // D12 is P0.13 (SDA)
    _DEFPIN_ARM(13, 0, 14); // D13 is P0.17 (INT)
    _DEFPIN_ARM(14, 0, 15); // D14 is P0.15 (INT1)
    _DEFPIN_ARM(15, 0, 20); // D15 is P0.20 (INT2)
    _DEFPIN_ARM(16, 0,  2); // D16 is P0.02 (A0)
    _DEFPIN_ARM(17, 0,  3); // D17 is P0.03 (A1)
    _DEFPIN_ARM(18, 0,  4); // D18 is P0.04 (A2)
    _DEFPIN_ARM(19, 0, 24); // D19 is P0.24 (A3, also D4/SPI MISO) -- is this right?
    _DEFPIN_ARM(20, 0, 29); // D20 is P0.29 (A4)
    _DEFPIN_ARM(21, 0, 30); // D21 is P0.30 (A5)
    _DEFPIN_ARM(22, 0, 31); // D22 is P0.31 (A6)
    _DEFPIN_ARM(23, 0,  8); // D23 is P0.08 (RX)
    _DEFPIN_ARM(24, 0,  6); // D24 is P0.06 (TX)
    _DEFPIN_ARM(25, 0,  5); // D25 is P0.05 (RTS)
    _DEFPIN_ARM(26, 0,  7); // D26 is P0.07 (CTS)
#endif // defined(ARDUINO_ELECTRONUT_BLUEY)

// Electronut labs hackaBLE
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/hackaBLE/variant.cpp
#if defined(ARDUINO_ELECTRONUT_HACKABLE)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Electronut labs hackaBLE is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM( 0, 0, 14); // D0  is P0.14 (RX)
    _DEFPIN_ARM( 1, 0, 13); // D1  is P0.13 (TX)
    _DEFPIN_ARM( 2, 0, 12); // D2  is P0.12
    _DEFPIN_ARM( 3, 0, 11); // D3  is P0.11 (SPI MOSI)
    _DEFPIN_ARM( 4, 0,  8); // D4  is P0.08 (SPI MISO)
    _DEFPIN_ARM( 5, 0,  7); // D5  is P0.07 (SPI SCK )
    _DEFPIN_ARM( 6, 0,  6); // D6  is P0.06
    _DEFPIN_ARM( 7, 0, 27); // D7  is P0.27
    _DEFPIN_ARM( 8, 0, 26); // D8  is P0.26
    _DEFPIN_ARM( 9, 0, 25); // D9  is P0.25
    _DEFPIN_ARM(10, 0,  5); // D10 is P0.05 (A3)
    _DEFPIN_ARM(11, 0,  4); // D11 is P0.04 (A2)
    _DEFPIN_ARM(12, 0,  3); // D12 is P0.03 (A1)
    _DEFPIN_ARM(13, 0,  2); // D13 is P0.02 (A0 / AREF)
    _DEFPIN_ARM(14, 0, 23); // D14 is P0.23
    _DEFPIN_ARM(15, 0, 22); // D15 is P0.22
    _DEFPIN_ARM(16, 0, 18); // D16 is P0.18
    _DEFPIN_ARM(17, 0, 16); // D17 is P0.16
    _DEFPIN_ARM(18, 0, 15); // D18 is P0.15
    _DEFPIN_ARM(19, 0, 24); // D19 is P0.24
    _DEFPIN_ARM(20, 0, 28); // D20 is P0.28 (A4)
    _DEFPIN_ARM(21, 0, 29); // D21 is P0.29 (A5)
    _DEFPIN_ARM(22, 0, 30); // D22 is P0.30 (A6)
    _DEFPIN_ARM(23, 0, 31); // D23 is P0.31 (A7)
    _DEFPIN_ARM(24, 0, 19); // D24 is P0.19 (RED LED)
    _DEFPIN_ARM(25, 0, 20); // D25 is P0.20 (GREEN LED)
    _DEFPIN_ARM(26, 0, 17); // D26 is P0.17 (BLUE LED)
#endif // defined(ARDUINO_ELECTRONUT_HACKABLE)

// Electronut labs hackaBLE_v2
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/hackaBLE_v2/variant.cpp
// (32 pins, natural mapping)
#if defined(ARDUINO_ELECTRONUT_hackaBLE_v2)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Electronut labs hackaBLE_v2 is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM_IDENTITY_P0( 0); // P0.00
    _DEFPIN_ARM_IDENTITY_P0( 1); // P0.01
    _DEFPIN_ARM_IDENTITY_P0( 2); // P0.02 (A0 / SDA / AREF)
    _DEFPIN_ARM_IDENTITY_P0( 3); // P0.03 (A1 / SCL )
    _DEFPIN_ARM_IDENTITY_P0( 4); // P0.04 (A2)
    _DEFPIN_ARM_IDENTITY_P0( 5); // P0.05 (A3)
    _DEFPIN_ARM_IDENTITY_P0( 6); // P0.06
    _DEFPIN_ARM_IDENTITY_P0( 7); // P0.07 (RX)
    _DEFPIN_ARM_IDENTITY_P0( 8); // P0.08 (TX)
    _DEFPIN_ARM_IDENTITY_P0( 9); // P0.09
    _DEFPIN_ARM_IDENTITY_P0(10); // P0.10
    _DEFPIN_ARM_IDENTITY_P0(11); // P0.11 (SPI MISO)
    _DEFPIN_ARM_IDENTITY_P0(12); // P0.12 (SPI MOSI)
    _DEFPIN_ARM_IDENTITY_P0(13); // P0.13 (SPI SCK )
    _DEFPIN_ARM_IDENTITY_P0(14); // P0.14 (SPI SS  )
    _DEFPIN_ARM_IDENTITY_P0(15); // P0.15
    _DEFPIN_ARM_IDENTITY_P0(16); // P0.16
    _DEFPIN_ARM_IDENTITY_P0(17); // P0.17 (BLUE LED)
    _DEFPIN_ARM_IDENTITY_P0(18); // P0.18
    _DEFPIN_ARM_IDENTITY_P0(19); // P0.19 (RED LED)
    _DEFPIN_ARM_IDENTITY_P0(20); // P0.20 (GREEN LED)
    // _DEFPIN_ARM_IDENTITY_P0(21); // P0.21 (RESET)
    _DEFPIN_ARM_IDENTITY_P0(22); // P0.22
    _DEFPIN_ARM_IDENTITY_P0(23); // P0.23
    _DEFPIN_ARM_IDENTITY_P0(24); // P0.24
    _DEFPIN_ARM_IDENTITY_P0(25); // P0.25
    _DEFPIN_ARM_IDENTITY_P0(26); // P0.26
    _DEFPIN_ARM_IDENTITY_P0(27); // P0.27
    _DEFPIN_ARM_IDENTITY_P0(28); // P0.28 (A4)
    _DEFPIN_ARM_IDENTITY_P0(29); // P0.29 (A5)
    _DEFPIN_ARM_IDENTITY_P0(30); // P0.30 (A6)
    _DEFPIN_ARM_IDENTITY_P0(31); // P0.31 (A7)
#endif // defined(ARDUINO_ELECTRONUT_hackaBLE_v2)

// RedBear Blend 2
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/RedBear_Blend2/variant.cpp
#if defined(ARDUINO_RB_BLEND_2)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "RedBear Blend 2 is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM( 0, 0, 11); // D0  is P0.11
    _DEFPIN_ARM( 1, 0, 12); // D1  is P0.12
    _DEFPIN_ARM( 2, 0, 13); // D2  is P0.13
    _DEFPIN_ARM( 3, 0, 14); // D3  is P0.14
    _DEFPIN_ARM( 4, 0, 15); // D4  is P0.15
    _DEFPIN_ARM( 5, 0, 16); // D5  is P0.16
    _DEFPIN_ARM( 6, 0, 17); // D6  is P0.17
    _DEFPIN_ARM( 7, 0, 18); // D7  is P0.18
    _DEFPIN_ARM( 8, 0, 19); // D8  is P0.19
    _DEFPIN_ARM( 9, 0, 20); // D9  is P0.20
    _DEFPIN_ARM(10, 0, 22); // D10 is P0.22 (SPI SS  )
    _DEFPIN_ARM(11, 0, 23); // D11 is P0.23 (SPI MOSI)
    _DEFPIN_ARM(12, 0, 24); // D12 is P0.24 (SPI MISO)
    _DEFPIN_ARM(13, 0, 25); // D13 is P0.25 (SPI SCK / LED)
    _DEFPIN_ARM(14, 0,  3); // D14 is P0.03 (A0)
    _DEFPIN_ARM(15, 0,  4); // D15 is P0.04 (A1)
    _DEFPIN_ARM(16, 0, 28); // D16 is P0.28 (A2)
    _DEFPIN_ARM(17, 0, 29); // D17 is P0.29 (A3)
    _DEFPIN_ARM(18, 0, 30); // D18 is P0.30 (A4)
    _DEFPIN_ARM(19, 0, 31); // D19 is P0.31 (A5)
    _DEFPIN_ARM(20, 0, 26); // D20 is P0.26 (SDA)
    _DEFPIN_ARM(21, 0, 27); // D21 is P0.27 (SCL)
    _DEFPIN_ARM(22, 0,  8); // D22 is P0.08 (RX)
    _DEFPIN_ARM(23, 0,  6); // D23 is P0.06 (TX)
    _DEFPIN_ARM(24, 0,  2); // D24 is P0.02 (AREF)
#endif // defined(ARDUINO_RB_BLEND_2)

// RedBear BLE Nano 2
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/RedBear_BLENano2/variant.cpp
#if defined(ARDUINO_RB_BLE_NANO_2)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "RedBear BLE Nano 2 is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM( 0, 0, 30); // D0  is P0.30 (A0 / RX)
    _DEFPIN_ARM( 1, 0, 29); // D1  is P0.29 (A1 / TX)
    _DEFPIN_ARM( 2, 0, 28); // D2  is P0.28 (A2 / SDA)
    _DEFPIN_ARM( 3, 0,  2); // D3  is P0.02 (A3 / SCL)
    _DEFPIN_ARM( 4, 0,  5); // D4  is P0.05 (A4)
    _DEFPIN_ARM( 5, 0,  4); // D5  is P0.04 (A5)
    _DEFPIN_ARM( 6, 0,  3); // D6  is P0.03 (SPI SS  )
    _DEFPIN_ARM( 7, 0,  6); // D7  is P0.06 (SPI MOSI)
    _DEFPIN_ARM( 8, 0,  7); // D8  is P0.07 (SPI MISO)
    _DEFPIN_ARM( 9, 0,  8); // D9  is P0.08 (SPI SCK )
    // _DEFPIN_ARM(10, 0, 21); // D10 is P0.21 (RESET)
    _DEFPIN_ARM(13, 0, 11); // D11 is P0.11 (LED)
#endif // defined(ARDUINO_RB_BLE_NANO_2)

// Nordic Semiconductor nRF52 DK
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/nRF52DK/variant.cpp
#if defined(ARDUINO_NRF52_DK)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Nordic Semiconductor nRF52 DK is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    _DEFPIN_ARM( 0, 0, 11); // D0  is P0.11
    _DEFPIN_ARM( 1, 0, 12); // D1  is P0.12
    _DEFPIN_ARM( 2, 0, 13); // D2  is P0.13 (BUTTON1)
    _DEFPIN_ARM( 3, 0, 14); // D3  is P0.14 (BUTTON2)
    _DEFPIN_ARM( 4, 0, 15); // D4  is P0.15 (BUTTON3)
    _DEFPIN_ARM( 5, 0, 16); // D5  is P0.16 (BUTTON4)
    _DEFPIN_ARM( 6, 0, 17); // D6  is P0.17 (LED1)
    _DEFPIN_ARM( 7, 0, 18); // D7  is P0.18 (LED2)
    _DEFPIN_ARM( 8, 0, 19); // D8  is P0.19 (LED3)
    _DEFPIN_ARM( 9, 0, 20); // D9  is P0.20 (LED4)
    _DEFPIN_ARM(10, 0, 22); // D10 is P0.22 (SPI SS  )
    _DEFPIN_ARM(11, 0, 23); // D11 is P0.23 (SPI MOSI)
    _DEFPIN_ARM(12, 0, 24); // D12 is P0.24 (SPI MISO)
    _DEFPIN_ARM(13, 0, 25); // D13 is P0.25 (SPI SCK / LED)
    _DEFPIN_ARM(14, 0,  3); // D14 is P0.03 (A0)
    _DEFPIN_ARM(15, 0,  4); // D15 is P0.04 (A1)
    _DEFPIN_ARM(16, 0, 28); // D16 is P0.28 (A2)
    _DEFPIN_ARM(17, 0, 29); // D17 is P0.29 (A3)
    _DEFPIN_ARM(18, 0, 30); // D18 is P0.30 (A4)
    _DEFPIN_ARM(19, 0, 31); // D19 is P0.31 (A5)
    _DEFPIN_ARM(20, 0,  5); // D20 is P0.05 (A6)
    _DEFPIN_ARM(21, 0,  2); // D21 is P0.02 (A7 / AREF)
    _DEFPIN_ARM(22, 0, 26); // D22 is P0.26 (SDA)
    _DEFPIN_ARM(23, 0, 27); // D23 is P0.27 (SCL)
    _DEFPIN_ARM(24, 0,  8); // D24 is P0.08 (RX)
    _DEFPIN_ARM(25, 0,  6); // D25 is P0.06 (TX)
#endif // defined(ARDUINO_NRF52_DK)

// Taida Century nRF52 mini board
// https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/Taida_Century_nRF52_minidev/variant.cpp
#if defined(ARDUINO_STCT_NRF52_minidev)
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Taida Century nRF52 mini board is an untested board -- test and let use know your results via https://github.com/FastLED/FastLED/issues"
    //_DEFPIN_ARM( 0, 0, 25); // D0  is P0.xx (near radio!)
    //_DEFPIN_ARM( 1, 0, 26); // D1  is P0.xx (near radio!)
    //_DEFPIN_ARM( 2, 0, 27); // D2  is P0.xx (near radio!)
    //_DEFPIN_ARM( 3, 0, 28); // D3  is P0.xx (near radio!)
    //_DEFPIN_ARM( 4, 0, 29); // D4  is P0.xx (Not connected, near radio!)
    //_DEFPIN_ARM( 5, 0, 30); // D5  is P0.xx (LED1, near radio!)
    //_DEFPIN_ARM( 6, 0, 31); // D6  is P0.xx (LED2, near radio!)
    _DEFPIN_ARM( 7, 0,  2); // D7  is P0.xx (SDA)
    _DEFPIN_ARM( 8, 0,  3); // D8  is P0.xx (SCL)
    _DEFPIN_ARM( 9, 0,  4); // D9  is P0.xx (BUTTON1 / NFC1)
    _DEFPIN_ARM(10, 0,  5); // D10 is P0.xx
    //_DEFPIN_ARM(11, 0,  0); // D11 is P0.xx (Not connected)
    //_DEFPIN_ARM(12, 0,  1); // D12 is P0.xx (Not connected)
    _DEFPIN_ARM(13, 0,  6); // D13 is P0.xx
    _DEFPIN_ARM(14, 0,  7); // D14 is P0.xx
    _DEFPIN_ARM(15, 0,  8); // D15 is P0.xx
    //_DEFPIN_ARM(16, 0,  9); // D16 is P0.xx (Not connected)
    //_DEFPIN_ARM(17, 0, 10); // D17 is P0.xx (NFC2, Not connected)
    _DEFPIN_ARM(18, 0, 11); // D18 is P0.xx (RXD)
    _DEFPIN_ARM(19, 0, 12); // D19 is P0.xx (TXD)
    _DEFPIN_ARM(20, 0, 13); // D20 is P0.xx (SPI SS  )
    _DEFPIN_ARM(21, 0, 14); // D21 is P0.xx (SPI MISO)
    _DEFPIN_ARM(22, 0, 15); // D22 is P0.xx (SPI MOSI)
    _DEFPIN_ARM(23, 0, 16); // D23 is P0.xx (SPI SCK )
    _DEFPIN_ARM(24, 0, 17); // D24 is P0.xx (A0)
    _DEFPIN_ARM(25, 0, 18); // D25 is P0.xx (A1)
    _DEFPIN_ARM(26, 0, 19); // D26 is P0.xx (A2)
    _DEFPIN_ARM(27, 0, 20); // D27 is P0.xx (A3)
    //_DEFPIN_ARM(28, 0, 22); // D28 is P0.xx (A4, near radio!)
    //_DEFPIN_ARM(29, 0, 23); // D29 is P0.xx (A5, near radio!)
    _DEFPIN_ARM(30, 0, 24); // D30 is P0.xx
    // _DEFPIN_ARM(31, 0, 21); // D31 is P0.21 (RESET)
#endif // defined(ARDUINO_STCT_NRF52_minidev)

// Generic nRF52832
// See https://github.com/sandeepmistry/arduino-nRF5/blob/master/boards.txt
#if defined(ARDUINO_GENERIC) && (\
    defined(NRF52832_XXAA) || defined(NRF52832_XXAB)\
    )
    #if defined(__FASTPIN_ARM_NRF52_VARIANT_FOUND)
        #error "Cannot define more than one board at a time"
    #else
        #define __FASTPIN_ARM_NRF52_VARIANT_FOUND
    #endif
    #warning "Using `generic` NRF52832 board is an untested configuration -- test and let use know your results via https://github.com/FastLED/FastLED/issues"

    _DEFPIN_ARM_IDENTITY_P0( 0); // P0.00 (    UART RX
    _DEFPIN_ARM_IDENTITY_P0( 1); // P0.01 (A0, UART TX)
    _DEFPIN_ARM_IDENTITY_P0( 2); // P0.02 (A1)
    _DEFPIN_ARM_IDENTITY_P0( 3); // P0.03 (A2)
    _DEFPIN_ARM_IDENTITY_P0( 4); // P0.04 (A3)
    _DEFPIN_ARM_IDENTITY_P0( 5); // P0.05 (A4)
    _DEFPIN_ARM_IDENTITY_P0( 6); // P0.06 (A5)
    _DEFPIN_ARM_IDENTITY_P0( 7); // P0.07
    _DEFPIN_ARM_IDENTITY_P0( 8); // P0.08
    _DEFPIN_ARM_IDENTITY_P0( 9); // P0.09
    _DEFPIN_ARM_IDENTITY_P0(10); // P0.10
    _DEFPIN_ARM_IDENTITY_P0(11); // P0.11
    _DEFPIN_ARM_IDENTITY_P0(12); // P0.12
    _DEFPIN_ARM_IDENTITY_P0(13); // P0.13 (LED)
    _DEFPIN_ARM_IDENTITY_P0(14); // P0.14
    _DEFPIN_ARM_IDENTITY_P0(15); // P0.15
    _DEFPIN_ARM_IDENTITY_P0(16); // P0.16
    _DEFPIN_ARM_IDENTITY_P0(17); // P0.17
    _DEFPIN_ARM_IDENTITY_P0(18); // P0.18
    _DEFPIN_ARM_IDENTITY_P0(19); // P0.19
    _DEFPIN_ARM_IDENTITY_P0(20); // P0.20 (I2C SDA)
    _DEFPIN_ARM_IDENTITY_P0(21); // P0.21 (I2C SCL)
    _DEFPIN_ARM_IDENTITY_P0(22); // P0.22 (SPI MISO)
    _DEFPIN_ARM_IDENTITY_P0(23); // P0.23 (SPI MOSI)
    _DEFPIN_ARM_IDENTITY_P0(24); // P0.24 (SPI SCK )
    _DEFPIN_ARM_IDENTITY_P0(25); // P0.25 (SPI SS  )
    _DEFPIN_ARM_IDENTITY_P0(26); // P0.26
    _DEFPIN_ARM_IDENTITY_P0(27); // P0.27
    _DEFPIN_ARM_IDENTITY_P0(28); // P0.28
    _DEFPIN_ARM_IDENTITY_P0(29); // P0.29
    _DEFPIN_ARM_IDENTITY_P0(30); // P0.30
    _DEFPIN_ARM_IDENTITY_P0(31); // P0.31
#endif // defined(ARDUINO_GENERIC)


#endif // __FASTPIN_ARM_NRF52_VARIANTS_H

<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonDocument/isNull.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("JsonDocument::isNull()") {
  DynamicJsonDocument doc(4096);

  SECTION("returns true if uninitialized") {
    REQUIRE(doc.isNull() == true);
  }

  SECTION("returns false after to<JsonObject>()") {
    doc.to<JsonObject>();
    REQUIRE(doc.isNull() == false);
  }

  SECTION("returns false after to<JsonArray>()") {
    doc.to<JsonArray>();
    REQUIRE(doc.isNull() == false);
  }

  SECTION("returns true after to<JsonVariant>()") {
    REQUIRE(doc.isNull() == true);
  }

  SECTION("returns false after set()") {
    doc.to<JsonVariant>().set(42);
    REQUIRE(doc.isNull() == false);
  }

  SECTION("returns true after clear()") {
    doc.to<JsonObject>();
    doc.clear();
    REQUIRE(doc.isNull() == true);
  }
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/Helpers/api/Print.h<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

class Print {
 public:
  virtual ~Print() {}

  virtual size_t write(uint8_t) = 0;
  virtual size_t write(const uint8_t *buffer, size_t size) = 0;

  size_t write(const char *str) {
    if (!str)
      return 0;
    return write(reinterpret_cast<const uint8_t *>(str), strlen(str));
  }

  size_t write(const char *buffer, size_t size) {
    return write(reinterpret_cast<const uint8_t *>(buffer), size);
  }
};

class Printable {
 public:
  virtual ~Printable() {}
  virtual size_t printTo(Print &p) const = 0;
};


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Polyfills/type_traits/remove_cv.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Namespace.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename T>
struct remove_cv {
  typedef T type;
};
template <typename T>
struct remove_cv<const T> {
  typedef T type;
};
template <typename T>
struct remove_cv<volatile T> {
  typedef T type;
};
template <typename T>
struct remove_cv<const volatile T> {
  typedef T type;
};
}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/IntegrationTests/issue772.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

// https://github.com/bblanchon/ArduinoJson/issues/772

TEST_CASE("Issue772") {
  DynamicJsonDocument doc1(4096);
  DynamicJsonDocument doc2(4096);
  DeserializationError err;
  std::string data =
      "{\"state\":{\"reported\":{\"timestamp\":\"2018-07-02T09:40:12Z\","
      "\"mac\":\"2C3AE84FC076\",\"firmwareVersion\":\"v0.2.7-5-gf4d4d78\","
      "\"visibleLight\":261,\"infraRed\":255,\"ultraViolet\":0.02,"
      "\"Temperature\":26.63,\"Pressure\":101145.7,\"Humidity\":54.79883,"
      "\"Vbat\":4.171261,\"soilMoisture\":0,\"ActB\":0}}}";
  err = deserializeJson(doc1, data);
  REQUIRE(err == DeserializationError::Ok);

  data = "";
  serializeMsgPack(doc1, data);
  err = deserializeMsgPack(doc2, data);

  REQUIRE(err == DeserializationError::Ok);
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/OssmUi/src/OssmUi.cpp<|end_filename|>

#include "OssmUi.h"

// speed and encoder state

volatile int s_speed_percentage = 0;
volatile int s_encoder_position = 0;
String s_message = "Machine Homing";

// KM logo

const uint8_t km_logo[] PROGMEM = {
  0xF8, 0xFF, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF,
  0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0xFF, 0x3F, 0xF8,
  0xFF, 0x87, 0xFF, 0x1F, 0xFC, 0xFF, 0x87, 0xFF, 0x0F, 0xFE, 0xFF, 0x87,
  0xFF, 0x07, 0xFF, 0xFF, 0x87, 0xFF, 0x83, 0xFF, 0xFF, 0x87, 0xFF, 0xC1,
  0xFF, 0xFF, 0x87, 0xFF, 0xE0, 0xFF, 0xFF, 0x87, 0x7F, 0x80, 0xFF, 0xE1,
  0x87, 0x3F, 0x80, 0xFF, 0xE1, 0x87, 0x1F, 0x84, 0xFF, 0xE1, 0x87, 0x1F,
  0x06, 0xFF, 0xE0, 0x87, 0x0F, 0x06, 0xFF, 0xE4, 0x87, 0x87, 0x07, 0xFE,
  0xE4, 0x87, 0x83, 0x6F, 0x7E, 0xE4, 0x87, 0xC1, 0x67, 0x7E, 0xE6, 0x07,
  0xE0, 0xC7, 0x3C, 0xE6, 0x07, 0xF0, 0xE7, 0x3C, 0xE7, 0x87, 0xE0, 0xC7,
  0x38, 0xE7, 0x87, 0xC1, 0xCF, 0x99, 0xE7, 0x87, 0x83, 0xE7, 0x91, 0xE7,
  0x87, 0x07, 0xC7, 0xC3, 0xE7, 0x87, 0x0F, 0xEE, 0xC3, 0xE7, 0x87, 0x1F,
  0xC4, 0xC7, 0xE7, 0x87, 0x1F, 0xE0, 0xE7, 0xE7, 0x87, 0x7F, 0xE0, 0xE7,
  0xE7, 0x87, 0xFF, 0xE0, 0xFF, 0xFF, 0x87, 0xFF, 0xC1, 0xFF, 0xFF, 0x87,
  0xFF, 0x81, 0xFF, 0xFF, 0x87, 0xFF, 0x07, 0xFF, 0xFF, 0x87, 0xFF, 0x07,
  0xFE, 0xFF, 0x87, 0xFF, 0x1F, 0xFC, 0xFF, 0x87, 0xFF, 0x1F, 0xF8, 0xFF,
  0x87, 0xFF, 0x7F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF,
  0xFF, 0xFF, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0x3F, };

// default activity symbols

const uint8_t s_active_symbol[8] PROGMEM = {
    B00000000,
    B00000000,
    B00011000,
    B00100100,
    B01000010,
    B01000010,
    B00100100,
    B00011000};

const uint8_t s_inactive_symbol[8] PROGMEM = {
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00011000,
    B00011000,
    B00000000,
    B00000000};

// default overlays and frames

static void OssmUiOverlaySpeed(OLEDDisplay* display, OLEDDisplayUiState* state)
{
    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(ArialMT_Plain_10);
    display->drawString(64, 0, "SPEED                STROKE");
    display->drawString(64, 50, s_message);

}
static void OssmUiFrameKMlogo(OLEDDisplay* display, OLEDDisplayUiState* state, int16_t x, int16_t y)
{

    //display->fillRect(10,14+(50-int(s_speed_percentage/2)),10,20-int(s_speed_percentage/100));
    display->fillRect(10,14+(34-int(s_speed_percentage/3)),10,int(s_speed_percentage/3));
    display->drawXbm(x + 44, y + 6, 40, 40, km_logo);
    //display->fillRect(106,64-int(s_encoder_position/2),10,64);
    display->fillRect(106,14+(34-int(s_encoder_position/3)),10,int(s_encoder_position/3));

}

const size_t s_overlay_count = 1;
OverlayCallback s_overlays[] = {OssmUiOverlaySpeed};

const size_t s_frame_count = 1;
FrameCallback s_frames[] = {OssmUiFrameKMlogo};

// OssmUi constructor and methods

OssmUi::OssmUi(uint8_t address, int sda, int scl)
    : m_display(address, sda, scl),
      m_ui(&m_display),
      m_address(address),
      m_check_connectivity_interval(250),
      m_connected(false),
      m_last_update_time(0)
{
    // fps
    m_ui.setTargetFPS(20);
    // activity indicators
    m_ui.setActiveSymbol(s_active_symbol);
    m_ui.setInactiveSymbol(s_inactive_symbol);
    // frames
    m_ui.setFrames(s_frames, s_frame_count);
    // overlays
    m_ui.setOverlays(s_overlays, s_overlay_count);
    // no auto transition
    m_ui.disableAutoTransition();
    // no transition animation
    m_ui.setTimePerTransition(0);
    // Get rid of the indicators on screen
    m_ui.disableAllIndicators();
}

void OssmUi::SetTargetFps(uint8_t target_fps)
{
    m_ui.setTargetFPS(target_fps);
}

void OssmUi::ResetState()
{
    m_display.end();
    m_display.init();
    m_display.flipScreenVertically();
    m_ui.switchToFrame(0);
}

void OssmUi::SetFrames(OverlayCallback* overlays, size_t overlays_count,
                       FrameCallback* frames, size_t frames_count)
{
    m_ui.setFrames(frames, frames_count);
    m_ui.setOverlays(overlays, overlays_count);
}

void OssmUi::SetActivitySymbols(const uint8_t *active, const uint8_t *inactive)
{
    m_ui.setActiveSymbol(active);
    m_ui.setInactiveSymbol(inactive);
}

void OssmUi::Setup()
{
    // OLED SETUP

    // You can change this to
    // TOP, LEFT, BOTTOM, RIGHT
    m_ui.setIndicatorPosition(LEFT);

    // Defines where the first frame is located in the bar.
    m_ui.setIndicatorDirection(LEFT_RIGHT);

    // Initialising the UI will init the display too.
    m_ui.init();

    // flip screen
    m_display.flipScreenVertically();




}

void OssmUi::UpdateState(const int speed_percentage, const int encoder_position)
{
    s_speed_percentage = speed_percentage;
    s_encoder_position = encoder_position;
}


void OssmUi::UpdateMessage( String message_in)
{
    s_message = message_in;
    m_ui.update();
}

void OssmUi::UpdateScreen()
{
    m_ui.update();

    // periodically check connectivity
    uint32_t now = millis();
    if (now - m_last_update_time > m_check_connectivity_interval)
    {
        m_last_update_time = now;
        Wire.beginTransmission(m_address);
        if (0 == Wire.endTransmission(m_address))
        {
            if (!m_connected)
            {
                ResetState();
            }
            m_connected = true;
        }
        else
        {
            m_connected = false;
        }
    }
}


void OssmUi::UpdateOnly()
{
    m_ui.update();

}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/FailingBuilds/delete_jsondocument.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>

struct Stream {};

int main() {
  JsonDocument* doc = new DynamicJsonDocument(42);
  delete doc;
}


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/src/ArduinoJson/Serialization/measure.hpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#pragma once

#include <ArduinoJson/Serialization/Writers/DummyWriter.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <template <typename> class TSerializer, typename TSource>
size_t measure(const TSource &source) {
  DummyWriter dp;
  TSerializer<DummyWriter> serializer(dp);
  return source.accept(serializer);
}

}  // namespace ARDUINOJSON_NAMESPACE


<|start_filename|>PlatformIO ESP32 code/OSSM_ESP32/lib/ArduinoJson-6.x/extras/tests/JsonDocument/remove.cpp<|end_filename|>
// ArduinoJson - https://arduinojson.org
// Copyright <NAME> 2014-2021
// MIT License

#include <ArduinoJson.h>
#include <catch.hpp>

TEST_CASE("JsonDocument::remove()") {
  DynamicJsonDocument doc(4096);

  SECTION("remove(int)") {
    doc.add(1);
    doc.add(2);
    doc.add(3);

    doc.remove(1);

    REQUIRE(doc.as<std::string>() == "[1,3]");
  }

  SECTION("remove(const char *)") {
    doc["a"] = 1;
    doc["b"] = 2;

    doc.remove("a");

    REQUIRE(doc.as<std::string>() == "{\"b\":2}");
  }

  SECTION("remove(std::string)") {
    doc["a"] = 1;
    doc["b"] = 2;

    doc.remove(std::string("b"));

    REQUIRE(doc.as<std::string>() == "{\"a\":1}");
  }

#ifdef HAS_VARIABLE_LENGTH_ARRAY
  SECTION("remove(vla)") {
    doc["a"] = 1;
    doc["b"] = 2;

    int i = 4;
    char vla[i];
    strcpy(vla, "b");
    doc.remove(vla);

    REQUIRE(doc.as<std::string>() == "{\"a\":1}");
  }
#endif
}
