@@ -19,7 +19,7 @@ constexpr auto BAUD_DEFAULT = 19200;
1919// constructor
2020
2121// / 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),
2323 _tx_pin(txPin),
2424 _nslp_pin(nslpPin)
2525{
@@ -33,21 +33,21 @@ Lin_TJA1020::Lin_TJA1020(int uart_nr, uint32_t _baud, int8_t rxPin, int8_t txPin
3333// write / read on bus
3434
3535// / Requests a Lin 2.0 Frame
36- bool Lin_TJA1020::readFrame (uint8_t FrameID)
36+ bool Lin_TJA1020::readFrame (const uint8_t FrameID)
3737{
3838 setMode (_writingSlope);
3939 return Lin_Interface::readFrame (FrameID);
4040}
4141
4242// / 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)
4444{
4545 setMode (_writingSlope);
4646 return Lin_Interface::writeFrame (FrameID, size);
4747}
4848
4949// / 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)
5151{
5252 setMode (_writingSlope);
5353 Lin_Interface::writeFrameClassic (FrameID, size);
@@ -57,7 +57,7 @@ void Lin_TJA1020::writeFrameClassic(uint8_t FrameID, size_t size)
5757// / NormalSlope, LowSlope for writing operation;
5858// / Sleep will release INH and may disables Power-Supply
5959// / @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)
6161{
6262 // we don't need to act, if we're allready there
6363 // see "setMode(sleep)" in the switch below
@@ -149,9 +149,10 @@ void Lin_TJA1020::setMode(TJA1020_Mode mode)
149149} // void Lin_TJA1020::setMode(TJA1020_Mode newMode)
150150
151151// / 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) {
153153 _writingSlope = slope;
154- if (_writingSlope == Sleep) {
154+ if (_writingSlope == Sleep)
155+ {
155156 _writingSlope = NormalSlope;
156157 }
157158}
0 commit comments