me-no-dev / RasPiArduino

Arduino Framework for RaspberryPI
326 stars 76 forks source link

UNKNOWN_REVISION when using on Raspberry PI with warranty bit set #83

Open idk-whatever opened 6 years ago

idk-whatever commented 6 years ago

When using this on a Raspberry PI with warranty bit set it'll stop with UNKNOWN_REVISION because info.revisionNumber on line 184 still has the warranty bit in it.

I fixed it by removing the warranty bit right after getRaspberryPiInformation but I don't have the time to create a good fix.

int init(){
  RASPBERRY_PI_INFO_T info;
  getRaspberryPiInformation(&info);

  info.revisionNumber &= ~0x3000000;

  uint32_t offset = info.peripheralBase - 0x20000000;
  ...
}