• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blues / note-arduino / 13460149159

21 Feb 2025 03:39PM CUT coverage: 94.831%. Remained the same
13460149159

Pull #134

github

web-flow
Merge e1ff25e3d into be22b4c5e
Pull Request #134: chore: Create `NoteDefines.h`

104 of 127 branches covered (81.89%)

Branch coverage included in aggregate %.

318 of 318 relevant lines covered (100.0%)

16.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/NoteSerial_Arduino.cpp
1
#include "NoteSerial_Arduino.hpp"
2

3
NoteSerial *
4
make_note_serial (
7✔
5
    NoteSerial::param_t serial_parameters_
6
)
7
{
8
    static NoteSerial * note_serial = nullptr;
9
    if (!serial_parameters_) {
7✔
10
        if (note_serial) {
3!
11
            delete note_serial;
3!
12
            note_serial = nullptr;
3✔
13
        }
14
    } else if (!note_serial) {
4✔
15
        MakeNoteSerial_ArduinoParameters * arduino_parameters = reinterpret_cast<MakeNoteSerial_ArduinoParameters *>(serial_parameters_);
3✔
16
        note_serial = new NoteSerial_Arduino(arduino_parameters->hw_serial, arduino_parameters->baud_rate);
3!
17
    }
18
    return note_serial;
7✔
19
}
20

21
NoteSerial_Arduino::NoteSerial_Arduino
20✔
22
(
23
    HardwareSerial & hw_serial_,
24
    size_t baud_rate_
25
) :
20✔
26
    _notecardSerial(hw_serial_),
20✔
27
    _notecardSerialSpeed(baud_rate_)
20✔
28
{
29
    _notecardSerial.begin(_notecardSerialSpeed);
20!
30
}
20✔
31

32
NoteSerial_Arduino::~NoteSerial_Arduino (
20✔
33
    void
34
)
20✔
35
{
36
    _notecardSerial.end();
20✔
37
}
20✔
38

39
size_t
40
NoteSerial_Arduino::available (
2✔
41
    void
42
)
43
{
44
    return _notecardSerial.available();
2✔
45
}
46

47
char
48
NoteSerial_Arduino::receive (
2✔
49
    void
50
)
51
{
52
    return _notecardSerial.read();
2✔
53
}
54

55
bool
56
NoteSerial_Arduino::reset (
4✔
57
    void
58
)
59
{
60
    _notecardSerial.end();
4✔
61
    _notecardSerial.begin(_notecardSerialSpeed);
4✔
62

63
    return true;
4✔
64
}
65

66
size_t
67
NoteSerial_Arduino::transmit (
6✔
68
    uint8_t *buffer,
69
    size_t size,
70
    bool flush
71
)
72
{
73
    size_t result;
74
    result = _notecardSerial.write(buffer, size);
6✔
75
    if (flush) {
6✔
76
        _notecardSerial.flush();
5✔
77
    }
78
    return result;
6✔
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc