File tree Expand file tree Collapse file tree
megaavr/libraries/Wire/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -732,9 +732,11 @@ twi_buf_index_t TwoWire::requestFrom(uint8_t address, twi_buf_index_t quantity
732732 badArg (" requestFrom requests more bytes then there is Buffer space" );
733733 }
734734 }
735- if (__builtin_constant_p (address) > 0x7F ) { // Compile-time check if address is actually 7 bit long
736- badArg (" Supplied address seems to be 8 bit. Only 7-bit-addresses are supported" );
737- return ;
735+ if (__builtin_constant_p (address)) {
736+ if (address > 0x7F ) { // Compile-time check if address is actually 7 bit long
737+ badArg (" Supplied address seems to be 8 bit. Only 7-bit-addresses are supported" );
738+ return 0 ; /* This return 0 is never actually returned, but it still generates a warning, and sometimes fails!*/
739+ }
738740 }
739741 if (quantity >= TWI_BUFFER_LENGTH) {
740742 quantity = TWI_BUFFER_LENGTH;
You can’t perform that action at this time.
0 commit comments