Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERIAL_TX_BUFFER_SIZE/SERIAL_RX_BUFFER_SIZE are not defined #10413

Open
1 task done
aaronw2 opened this issue Oct 3, 2024 · 1 comment
Open
1 task done

SERIAL_TX_BUFFER_SIZE/SERIAL_RX_BUFFER_SIZE are not defined #10413

aaronw2 opened this issue Oct 3, 2024 · 1 comment
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@aaronw2
Copy link

aaronw2 commented Oct 3, 2024

Board

custom esp32s3 board

Device Description

Custom board with ESP32S3 and FUSB302 chip connected to USB-C port. The problem is unrelated to the board.

Hardware Configuration

ESP32S3 with FUSB302 i2c chip connected. The problem is related to SERIAL_TX_BUFFER_SIZE not being defined for the FUSB302 library.

Version

v3.0.4

IDE Name

Arduino 2.3.3

Operating System

Linux

Flash frequency

40MHz

PSRAM enabled

yes

Upload speed

921600

Description

I am attempting to use the FUSB302_UFP library, which fails to compile because it expects SERIAL_TX_BUFFER_SIZE to be defined. Performing a grep, I see it is also used by the MobaLedLib library and possibly several others. Using a hard-coded value may be problematic, so this may require more work with HardwareSerial.h to figure out what the current size is.

Sketch

#include <Wire.h>
#include <PD_UFP.h>

#define FUSB302_INT_PIN   12

PD_UFP_c PD_UFP;

void setup() {
  Wire.begin();
  PD_UFP.init(FUSB302_INT_PIN, PD_POWER_OPTION_MAX_20V);
  
  Serial.begin(9600);
}

void loop() {
  PD_UFP.run();
  if (PD_UFP.is_power_ready())
  {
    Serial.write("PD supply connected\n");
  }
  else
  {
    Serial.write("No PD supply available\n");
  }
}

Debug Message

/home/aaronw/Arduino/libraries/FUSB302_PD_UFP_sink/src/PD_UFP_Log.cpp: In member function 'void PD_UFP_Log_c::print_status(HardwareSerial&)':
/home/aaronw/Arduino/libraries/FUSB302_PD_UFP_sink/src/PD_UFP_Log.cpp:234:49: error: 'SERIAL_TX_BUFFER_SIZE' was not declared in this scope
  234 |     if (serial && serial.availableForWrite() >= SERIAL_TX_BUFFER_SIZE - 1) {
      |                                                 ^~~~~~~~~~~~~~~~~~~~~
/home/aaronw/Arduino/libraries/FUSB302_PD_UFP_sink/src/PD_UFP_Log.cpp:236:33: error: 'buf' was not declared in this scope
  236 |         if (status_log_readline(buf, sizeof(buf) - 1)) {
      |                                 ^~~

exit status 1

Compilation error: exit status 1

Other Steps to Reproduce

No other steps needed.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@aaronw2 aaronw2 added the Status: Awaiting triage Issue is waiting for triage label Oct 3, 2024
@BaiHengRui
Copy link

BaiHengRui commented Oct 6, 2024

PD_UFP_Log_c PD_UFP;

char buf[100];

在主程序里定义一个buf即可。
PD_UFP_Log.cpp
{67B8227A-2C09-4A74-A391-50777D3ABA3E}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

2 participants