@@ -70,22 +70,22 @@ modm::Mcp2515<SPI, CS, INT>::initializeWithPrescaler(
7070 // software reset for the mcp2515, after this the chip is back in the
7171 // configuration mode
7272 chipSelect.reset ();
73- spi.transferBlocking (RESET);
73+ spi.transferBlocking (uint8_t ( RESET) );
7474 modm::delay_ms (1 );
7575 chipSelect.set ();
7676
7777 // wait a bit to give the MCP2515 some time to restart
7878 modm::delay_ms (30 );
7979
8080 chipSelect.reset ();
81- spi.transferBlocking (WRITE);
82- spi.transferBlocking (CNF3);
81+ spi.transferBlocking (uint8_t ( WRITE) );
82+ spi.transferBlocking (uint8_t ( CNF3) );
8383
8484 // load CNF1..3
85- spi.transferBlocking (cnf, nullptr , 3 );
85+ spi.transferBlocking (cnf, ( uint8_t *)( nullptr ) , 3 );
8686
8787 // enable interrupts
88- spi.transferBlocking (RX1IE | RX0IE);
88+ spi.transferBlocking (uint8_t ( RX1IE | RX0IE) );
8989 chipSelect.set ();
9090
9191 // set TXnRTS pins as inwrites
@@ -146,7 +146,7 @@ modm::Mcp2515<SPI, CS, INT>::setFilter(accessor::Flash<uint8_t> filter)
146146 for (i = 0 ; i < 0x30 ; i += 0x10 )
147147 {
148148 chipSelect.reset ();
149- spi.transferBlocking (WRITE);
149+ spi.transferBlocking (uint8_t ( WRITE) );
150150 spi.transferBlocking (i);
151151
152152 for (j = 0 ; j < 12 ; j++)
@@ -222,10 +222,10 @@ modm::Mcp2515<SPI, CS, INT>::getMessage(can::Message& message)
222222 else {
223223 message.flags .rtr = false ;
224224 }
225- message.length = spi.transferBlocking (0xff ) & 0x0f ;
225+ message.length = spi.transferBlocking (uint8_t ( 0xff ) ) & 0x0f ;
226226
227227 for (uint8_t i = 0 ; i < message.length ; ++i) {
228- message.data [i] = spi.transferBlocking (0xff );
228+ message.data [i] = spi.transferBlocking (uint8_t ( 0xff ) );
229229 }
230230 chipSelect.set ();
231231
@@ -279,12 +279,12 @@ modm::Mcp2515<SPI, CS, INT>::sendMessage(const can::Message& message)
279279 }
280280
281281 chipSelect.reset ();
282- spi.transferBlocking (WRITE_TX | address);
282+ spi.transferBlocking (uint8_t ( WRITE_TX | address) );
283283 writeIdentifier (message.identifier , message.flags .extended );
284284
285285 // if the message is a rtr-frame, is has a length but no attached data
286286 if (message.flags .rtr ) {
287- spi.transferBlocking (MCP2515_RTR | message.length );
287+ spi.transferBlocking (uint8_t ( MCP2515_RTR | message.length ) );
288288 }
289289 else {
290290 spi.transferBlocking (message.length );
@@ -300,7 +300,7 @@ modm::Mcp2515<SPI, CS, INT>::sendMessage(const can::Message& message)
300300 // send message via RTS command
301301 chipSelect.reset ();
302302 address = (address == 0 ) ? 1 : address; // 0 2 4 => 1 2 4
303- spi.transferBlocking (RTS | address);
303+ spi.transferBlocking (uint8_t ( RTS | address) );
304304 chipSelect.set ();
305305
306306 return address;
@@ -314,7 +314,7 @@ modm::Mcp2515<SPI, CS, INT>::writeRegister(uint8_t address, uint8_t data)
314314{
315315 chipSelect.reset ();
316316
317- spi.transferBlocking (WRITE);
317+ spi.transferBlocking (uint8_t ( WRITE) );
318318 spi.transferBlocking (address);
319319 spi.transferBlocking (data);
320320
@@ -327,9 +327,9 @@ modm::Mcp2515<SPI, CS, INT>::readRegister(uint8_t address)
327327{
328328 chipSelect.reset ();
329329
330- spi.transferBlocking (READ);
330+ spi.transferBlocking (uint8_t ( READ) );
331331 spi.transferBlocking (address);
332- uint8_t data = spi.transferBlocking (0xff );
332+ uint8_t data = spi.transferBlocking (uint8_t ( 0xff ) );
333333
334334 chipSelect.set ();
335335
@@ -342,7 +342,7 @@ modm::Mcp2515<SPI, CS, INT>::bitModify(uint8_t address, uint8_t mask, uint8_t da
342342{
343343 chipSelect.reset ();
344344
345- spi.transferBlocking (BIT_MODIFY);
345+ spi.transferBlocking (uint8_t ( BIT_MODIFY) );
346346 spi.transferBlocking (address);
347347 spi.transferBlocking (mask);
348348 spi.transferBlocking (data);
@@ -357,7 +357,7 @@ modm::Mcp2515<SPI, CS, INT>::readStatus(uint8_t type)
357357 chipSelect.reset ();
358358
359359 spi.transferBlocking (type);
360- uint8_t data = spi.transferBlocking (0xff );
360+ uint8_t data = spi.transferBlocking (uint8_t ( 0xff ) );
361361
362362 chipSelect.set ();
363363
@@ -391,10 +391,10 @@ modm::Mcp2515<SPI, CS, INT>::writeIdentifier(const uint32_t& identifier,
391391 }
392392 else
393393 {
394- spi.transferBlocking (*((uint16_t *) ptr) >> 3 );
395- spi.transferBlocking (*((uint8_t *) ptr) << 5 );
396- spi. transferBlocking ( 0 );
397- spi.transferBlocking (0 );
394+ spi.transferBlocking (uint8_t ( *((uint16_t *) ptr) >> 3 ) );
395+ spi.transferBlocking (uint8_t ( *((uint8_t *) ptr) << 5 ) );
396+
397+ spi.transferBlocking (uint16_t ( 0 ) );
398398 }
399399}
400400
@@ -406,31 +406,31 @@ modm::Mcp2515<SPI, CS, INT>::readIdentifier(uint32_t& identifier)
406406
407407 uint32_t *ptr = &identifier;
408408
409- uint8_t first = spi.transferBlocking (0xff );
410- uint8_t second = spi.transferBlocking (0xff );
409+ uint8_t first = spi.transferBlocking (uint8_t ( 0xff ) );
410+ uint8_t second = spi.transferBlocking (uint8_t ( 0xff ) );
411411
412412 if (second & MCP2515_IDE)
413413 {
414414 *((uint16_t *) ptr + 1 ) = (uint16_t ) first << 5 ;
415- *((uint8_t *) ptr + 1 ) = spi.transferBlocking (0xff );
415+ *((uint8_t *) ptr + 1 ) = spi.transferBlocking (uint8_t ( 0xff ) );
416416
417417 *((uint8_t *) ptr + 2 ) |= (second >> 3 ) & 0x1C ;
418418 *((uint8_t *) ptr + 2 ) |= second & 0x03 ;
419419
420- *((uint8_t *) ptr) = spi.transferBlocking (0xff );
420+ *((uint8_t *) ptr) = spi.transferBlocking (uint8_t ( 0xff ) );
421421
422422 return true ;
423423 }
424424 else
425425 {
426- spi.transferBlocking (0xff );
426+ spi.transferBlocking (uint8_t ( 0xff ) );
427427
428428 *((uint8_t *) ptr + 3 ) = 0 ;
429429 *((uint8_t *) ptr + 2 ) = 0 ;
430430
431431 *((uint16_t *) ptr) = (uint16_t ) first << 3 ;
432432
433- spi.transferBlocking (0xff );
433+ spi.transferBlocking (uint8_t ( 0xff ) );
434434
435435 *((uint8_t *) ptr) |= second >> 5 ;
436436
0 commit comments