Skip to content

Commit

Permalink
update build flags to detect nano boards
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Unger committed Jan 10, 2024
1 parent c0f3e2f commit d5748ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/drivers/simplefocnano/SimpleFOCNanoDriver.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

#include "./SimpleFOCNanoDriver.h"

#if defined(ARDUINO_NANO_ESP32) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_ARDUINO_NANO33BLE) || defined(ARDUINO_AVR_NANO)

SimpleFOCNanoDriver::SimpleFOCNanoDriver() : BLDCDriver3PWM(PIN_INU, PIN_INV, PIN_INW, PIN_ENU, PIN_ENV, PIN_ENW) {
// nothing to do here
};
Expand Down Expand Up @@ -66,3 +68,4 @@ float SimpleFOCNanoDriver::getBusVoltage(float vdd_voltage, int adc_resolution)
return sum / 500.0 * VBUS_CONV_FACTOR * (vdd_voltage / adc_resolution);
};

#endif
4 changes: 4 additions & 0 deletions src/drivers/simplefocnano/SimpleFOCNanoDriver.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

#pragma once


#include <drivers/BLDCDriver3PWM.h>

#if defined(ARDUINO_NANO_ESP32) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_ARDUINO_NANO33BLE) || defined(ARDUINO_AVR_NANO)

/*
* Default pins for the SimpleFOC Nano board
*
Expand Down Expand Up @@ -54,3 +57,4 @@ class SimpleFOCNanoDriver : public BLDCDriver3PWM {
float getBusVoltage(float vdd_voltage, int adc_resolution);
};

#endif

0 comments on commit d5748ec

Please sign in to comment.