пример работает
This commit is contained in:
1 parent
7c266d6521
commit
39b9d95d52
2 files changed
+7
-10
No files matched your search
@@ -28,10 +28,7 @@ SoftwareSerial mySerial(2, 6); // RX, TX
|
||||
void setup() {
|
||||
// Open serial communications and wait for port to open:
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
; // wait for serial port to connect. Needed for native USB port only
|
||||
}
|
||||
|
||||
while (!Serial) ; // wait for serial port to connect. Needed for native USB port only
|
||||
Serial.println("Goodnight moon!");
|
||||
|
||||
// set the data rate for the SoftwareSerial port
|
||||
@@ -40,10 +37,11 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() { // run over and over
|
||||
if (mySerial.available()) {
|
||||
while (mySerial.available())
|
||||
Serial.write(mySerial.read());
|
||||
}
|
||||
if (Serial.available()) {
|
||||
|
||||
while (Serial.available())
|
||||
mySerial.write(Serial.read());
|
||||
}
|
||||
|
||||
delay(50);
|
||||
}
|
||||
@@ -145,8 +145,7 @@ void SoftwareSerial::handle_interrupt() // .ram_text
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void softSerial_interrupt_handler(void) __attribute__((noinline, section(".ram_text")));
|
||||
extern "C" void softSerial_interrupt_handler(void)
|
||||
extern "C" void __attribute__((noinline, section(".ram_text"))) softSerial_interrupt_handler(void)
|
||||
{
|
||||
SoftwareSerial::handle_interrupt();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user