Testato / SoftwareWire

Creates a software I2C/TWI bus on every pins
GNU General Public License v3.0
148 stars 33 forks source link

'digitalPinToBitMask' was not declared in this scope #36

Open ratio-x opened 2 years ago

ratio-x commented 2 years ago

Trying to compile on NANO 33 BLE I'm getting following error:

c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp: In constructor 'SoftwareWire::SoftwareWire(uint8_t, uint8_t, boolean, boolean)':
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:130:18: error: 'digitalPinToBitMask' was not declared in this scope
   _sdaBitMask  = digitalPinToBitMask(_sdaPin);
                  ^~~~~~~~~~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:130:18: note: suggested alternative: 'digitalPinToPinName'
   _sdaBitMask  = digitalPinToBitMask(_sdaPin);
                  ^~~~~~~~~~~~~~~~~~~
                  digitalPinToPinName
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:131:18: error: 'portOutputRegister' was not declared in this scope
   _sdaPortReg  = portOutputRegister(port);
                  ^~~~~~~~~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:132:18: error: 'portModeRegister' was not declared in this scope
   _sdaDirReg   = portModeRegister(port);
                  ^~~~~~~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:132:18: note: suggested alternative: 'register'
   _sdaDirReg   = portModeRegister(port);
                  ^~~~~~~~~~~~~~~~
                  register
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:133:18: error: 'portInputRegister' was not declared in this scope
   _sdaPinReg   = portInputRegister(port);      // PinReg is the input register, not the Arduino pin.
                  ^~~~~~~~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp: In member function 'void SoftwareWire::setClock(uint32_t)':
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:438:18: error: 'F_CPU' was not declared in this scope
   _i2cdelay = ( (F_CPU / 32L) / clock );               // The delay in microseconds, '32' is for this code.
                  ^~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:438:18: note: suggested alternative: 'FPU'
   _i2cdelay = ( (F_CPU / 32L) / clock );               // The delay in microseconds, '32' is for this code.
                  ^~~~~
                  FPU
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp: In member function 'void SoftwareWire::printStatus(arduino::Print&)':
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:477:15: error: 'F_CPU' was not declared in this scope
   Ser.println(F_CPU);
               ^~~~~
               c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:477:15: note: suggested alternative: 'FPU'
   Ser.println(F_CPU);
               ^~~~~
               FPU
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:523:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sdaPortReg, HEX);
                           ^~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:525:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sclPortReg, HEX);
                           ^~~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:527:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sdaDirReg, HEX);
                           ^~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:529:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sclDirReg, HEX);
                           ^~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:531:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sdaPinReg, HEX);
                           ^~~~~~~~~~
c:\somepath\Arduino\libraries\SoftwareWire\SoftwareWire.cpp:533:27: error: cast from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]
   Ser.println( (uint16_t) _sclPinReg, HEX);
                           ^~~~~~~~~~
Compilation error: exit status 1}