@@ -19,7 +19,7 @@ constexpr auto BAUD_DEFAULT = 19200;
19
19
// constructor
20
20
21
21
// / Provides HW UART via TJA1020 Chip
22
- Lin_TJA1020::Lin_TJA1020 (int uart_nr, uint32_t _baud, int8_t rxPin, int8_t txPin, int8_t nslpPin) : Lin_Interface(uart_nr),
22
+ Lin_TJA1020::Lin_TJA1020 (const int uart_nr, const uint32_t _baud, const int8_t rxPin, const int8_t txPin, const int8_t nslpPin) : Lin_Interface(uart_nr),
23
23
_tx_pin(txPin),
24
24
_nslp_pin(nslpPin)
25
25
{
@@ -33,21 +33,21 @@ Lin_TJA1020::Lin_TJA1020(int uart_nr, uint32_t _baud, int8_t rxPin, int8_t txPin
33
33
// write / read on bus
34
34
35
35
// / Requests a Lin 2.0 Frame
36
- bool Lin_TJA1020::readFrame (uint8_t FrameID)
36
+ bool Lin_TJA1020::readFrame (const uint8_t FrameID)
37
37
{
38
38
setMode (_writingSlope);
39
39
return Lin_Interface::readFrame (FrameID);
40
40
}
41
41
42
42
// / Sends a Lin 2.0 Frame
43
- void Lin_TJA1020::writeFrame (uint8_t FrameID, size_t size)
43
+ void Lin_TJA1020::writeFrame (const uint8_t FrameID, const size_t size)
44
44
{
45
45
setMode (_writingSlope);
46
46
return Lin_Interface::writeFrame (FrameID, size);
47
47
}
48
48
49
49
// / Sends a Lin 1.3 Frame (Legacy Checksum)
50
- void Lin_TJA1020::writeFrameClassic (uint8_t FrameID, size_t size)
50
+ void Lin_TJA1020::writeFrameClassic (const uint8_t FrameID, const size_t size)
51
51
{
52
52
setMode (_writingSlope);
53
53
Lin_Interface::writeFrameClassic (FrameID, size);
@@ -57,7 +57,7 @@ void Lin_TJA1020::writeFrameClassic(uint8_t FrameID, size_t size)
57
57
// / NormalSlope, LowSlope for writing operation;
58
58
// / Sleep will release INH and may disables Power-Supply
59
59
// / @param mode TJA1020 Mode to be the next
60
- void Lin_TJA1020::setMode (TJA1020_Mode mode)
60
+ void Lin_TJA1020::setMode (const TJA1020_Mode mode)
61
61
{
62
62
// we don't need to act, if we're allready there
63
63
// see "setMode(sleep)" in the switch below
@@ -149,9 +149,10 @@ void Lin_TJA1020::setMode(TJA1020_Mode mode)
149
149
} // void Lin_TJA1020::setMode(TJA1020_Mode newMode)
150
150
151
151
// / Defines standard slope, to be used, when writing to the bus
152
- void Lin_TJA1020::setSlope (TJA1020_Mode slope) {
152
+ void Lin_TJA1020::setSlope (const TJA1020_Mode slope) {
153
153
_writingSlope = slope;
154
- if (_writingSlope == Sleep) {
154
+ if (_writingSlope == Sleep)
155
+ {
155
156
_writingSlope = NormalSlope;
156
157
}
157
158
}
0 commit comments