Skip to content

Commit d386374

Browse files
committed
Minor bug fixes
1 parent 46663ab commit d386374

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Example
2222
-------
2323
First, install the Morse library into your instance of the Arduino IDE as described above.
2424

25-
There two simple examples named **morse_example_avr.ino** and **morse_example_samd.ino** that are placed in your examples menu under the Etherkit Morse folder. Open one corresponding to the Arduino variant on which you will be running the example.
25+
There two simple examples named **morse_example_avr.ino** and **morse_example_samd.ino** that are placed in your examples menu under the Etherkit Morse folder. Open one corresponding to the Arduino variant on which you will be running the example. If you are using an AVR-based Arduino (such as an Uno), you'll want to also install the SimpleTimer library found (here)[https://playground.arduino.cc/Code/SimpleTimer].
2626

2727
In order to use the Morse library in your sketch, you must first instantiate an object of class Morse:
2828

@@ -112,7 +112,7 @@ void Morse::send(char * message)
112112
/*
113113
* Morse::reset()
114114
*
115-
* Halts and sending in progress, empties the message buffer, and resets the
115+
* Halts any sending in progress, empties the message buffer, and resets the
116116
* Morse state machine.
117117
*
118118
*/
@@ -143,6 +143,9 @@ The standard uppercase and lowercase letters 'A' through 'Z' and digits '0' thro
143143

144144
Changelog
145145
---------
146+
* v1.1.1
147+
148+
* Minor bug and documentation fixes.
146149

147150
* v1.1.0
148151

examples/morse_example_avr/morse_example_avr.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
*
55
* Copyright (C) 2018 Jason Milldrum <milldrum@gmail.com>
66
*
7+
* Uses the SimpleTimer library which you can find here:
8+
* https://playground.arduino.cc/Code/SimpleTimer
9+
*
710
* This program is free software: you can redistribute it and/or modify
811
* it under the terms of the GNU General Public License as published by
912
* the Free Software Foundation, either version 3 of the License, or

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Etherkit Morse
2-
version=1.1.0
2+
version=1.1.1
33
author=Jason Milldrum <milldrum@gmail.com>
44
maintainer=Jason Milldrum <milldrum@gmail.com>
55
sentence=Generate Morse Code for transmission on an digital I/O pin.

src/Morse.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,23 @@ void Morse::update()
263263
case State::DIT:
264264
case State::DAH:
265265
tx = true;
266-
if(output_pin)
266+
if(dfcw_mode)
267267
{
268+
// if(output_pin)
269+
// {
270+
// digitalWrite(output_pin, LOW);
271+
// }
268272
digitalWrite(output_pin, HIGH);
273+
digitalWrite(led_pin, HIGH);
274+
}
275+
else
276+
{
277+
if(output_pin)
278+
{
279+
digitalWrite(output_pin, HIGH);
280+
}
281+
digitalWrite(led_pin, HIGH);
269282
}
270-
digitalWrite(led_pin, HIGH);
271283

272284
if(cur_timer > cur_state_end)
273285
{
@@ -345,6 +357,7 @@ void Morse::update()
345357
// Clear the message buffer when message sending is complete
346358
memset(msg_buffer, 0, TX_BUFFER_SIZE + 1);
347359
busy = false;
360+
cur_char = 0;
348361
if(dfcw_mode)
349362
{
350363
digitalWrite(led_pin, LOW);
@@ -405,13 +418,14 @@ void Morse::send(char * message)
405418
/*
406419
* Morse::reset()
407420
*
408-
* Halts and sending in progress, empties the message buffer, and resets the
421+
* Halts any sending in progress, empties the message buffer, and resets the
409422
* Morse state machine.
410423
*
411424
*/
412425
void Morse::reset()
413426
{
414-
strcpy((char *)msg_buffer, "");
427+
// strcpy((char *)msg_buffer, "");
428+
memset(msg_buffer, 0, TX_BUFFER_SIZE + 1);
415429
cur_msg_p = msg_buffer;
416430
cur_char = 0;
417431
cur_state = State::IDLE;

0 commit comments

Comments
 (0)