Skip to content

Commit d5748ec

Browse files
author
Richard Unger
committed
update build flags to detect nano boards
1 parent c0f3e2f commit d5748ec

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/drivers/simplefocnano/SimpleFOCNanoDriver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
#include "./SimpleFOCNanoDriver.h"
33

4+
#if defined(ARDUINO_NANO_ESP32) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_ARDUINO_NANO33BLE) || defined(ARDUINO_AVR_NANO)
5+
46
SimpleFOCNanoDriver::SimpleFOCNanoDriver() : BLDCDriver3PWM(PIN_INU, PIN_INV, PIN_INW, PIN_ENU, PIN_ENV, PIN_ENW) {
57
// nothing to do here
68
};
@@ -66,3 +68,4 @@ float SimpleFOCNanoDriver::getBusVoltage(float vdd_voltage, int adc_resolution)
6668
return sum / 500.0 * VBUS_CONV_FACTOR * (vdd_voltage / adc_resolution);
6769
};
6870

71+
#endif

src/drivers/simplefocnano/SimpleFOCNanoDriver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11

22
#pragma once
33

4+
45
#include <drivers/BLDCDriver3PWM.h>
56

7+
#if defined(ARDUINO_NANO_ESP32) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_ARDUINO_NANO33BLE) || defined(ARDUINO_AVR_NANO)
8+
69
/*
710
* Default pins for the SimpleFOC Nano board
811
*
@@ -54,3 +57,4 @@ class SimpleFOCNanoDriver : public BLDCDriver3PWM {
5457
float getBusVoltage(float vdd_voltage, int adc_resolution);
5558
};
5659

60+
#endif

0 commit comments

Comments
 (0)