Arduino 中的串行函数在哪里定义?

Where are the Serial functions in Arduino defined?

在哪个文件中实际定义了 .begin()、.flush() 以及此处引用的所有其他 arduino 等串行函数。cc/en/Reference/Serial?

在 AndroidStudio 中,您只需按住 Control 键并单击一个方法,它就会打开定义该方法的文件。为什么 Arduino IDE 的事情必须如此困难?是否有 Arduino 的替代方案 IDE 可以让人们深入研究 arduino 核心,而无需花费数小时搜索定义内容的文件。

编辑: "Eclipse for Arduino" 帮了我大忙。您只需按住 Control 键并单击函数即可打开其定义。

刚刚查了一下,在hardware/arduino/avr/cores/arduino/HardwareSerial.h 但是,Arduino 编译器设置为自动包含必要的 headers(可能通过同一目录中的 Arduino.h),因此您实际上不需要包含任何内容即可使用它。