Skip to content

Commit b06ce03

Browse files
committed
RPI compile errors
1 parent 4226b44 commit b06ce03

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

ArduinoCore-Linux/cores/rasperry_pi/HardwareGPIO_RPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace arduino {
1313
static std::map<pin_size_t, gpiod_line*> gpio_lines;
1414
static gpiod_chip* gpio_chip = nullptr;
1515

16-
HardwareGPIO_RPI::begin() {
16+
void HardwareGPIO_RPI::begin() {
1717
Logger.warning("Activating Rasperry PI: GPIO");
1818
gpio_chip = gpiod_chip_open_by_name(device_name);
1919
if (!gpio_chip) {

ArduinoCore-Linux/cores/rasperry_pi/HardwareGPIO_RPI.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,24 @@ class HardwareGPIO_RPI : public HardwareGPIO {
2525
* @brief Constructor for HardwareGPIO_RPI.
2626
*/
2727
HardwareGPIO_RPI() = default;
28+
29+
/**
30+
* @brief Constructor for HardwareGPIO_RPI with custom device name.
31+
* @param devName Name of the GPIO chip device (e.g., "gpiochip0").
32+
*/
2833
HardwareGPIO_RPI(const char* devName) : device_name(devName) {}
2934

3035
/**
3136
* @brief Destructor for HardwareGPIO_RPI.
3237
*/
3338
~HardwareGPIO_RPI();
3439

40+
/**
41+
* @brief Initialize the GPIO hardware interface for Raspberry Pi.
42+
*
43+
* Opens the GPIO chip device and prepares the class for GPIO operations.
44+
* Should be called before using any GPIO functions.
45+
*/
3546
void begin();
3647

3748
/**
@@ -104,11 +115,8 @@ class HardwareGPIO_RPI : public HardwareGPIO {
104115
operator bool() { return is_open; }
105116

106117
private:
107-
/** Analog reference mode (default AR_DEFAULT) */
108118
int m_analogReference = 0;
109-
/** Map of pin numbers to their PWM frequencies */
110119
std::map<pin_size_t, uint32_t> gpio_frequencies;
111-
/** PWM-capable pins on Raspberry Pi */
112120
int pwm_pins[4] = {12, 13, 18, 19};
113121
bool is_open = false;
114122
const char* device_name = "gpiochip0";

0 commit comments

Comments
 (0)