Uno to Nano 33 BLE code issue

Hi, sorry to disturb your slumber. i've got code that runs on Uno, but breaks on Nano 33 BLE. It has issues with a volatile, "RwReg does not name a type". I was just wondering if there was a quick fix for this.

Not sure if RwReg is a variable or a type of variable.

This is the code making the error:
volatile RwReg *dataport, *clkport, *csport, *rsport;
uint32_t _cs, _rs, _sid, _sclk,
datapinmask, clkpinmask, cspinmask, rspinmask,
colstart, rowstart;

This is the error given:
'RwReg' does not name a type

These are two unconnected lines of code showing what is being done with dataport variable:

  if(c & bit) *dataport |=  datapinmask;

dataport    = portOutputRegister(digitalPinToPort(_sid));

I'm using IDE 1.8.16 if that helps

I just wondered if there was a quick fix for this. Thank you brothers and sisters.

Also, can't find RwReg anywhere else in the code or in the library. Not sure what it is.
It's for the ov7670 camera if that helps.

The UNO is an AVR, but the Nano 33 BLE is an ARM - so you have something that needs to be updated to be compatible with ARM ...

Check all the libraries you're using - are they all compatible with the Nano 33 BLE ?

That's an error message: the compiler tells you it does not name a type because it's in a place where it should name a type.

It needs to be a type.

Sounds like it's supposed to represent a Register with both Read & Write access.

Hi, thanks so much for replying. The creator made it for Uno (and Nano and Mega) and there's no version intended for the Nano33BLE.

Is this something I could easily alter if I change all the types to something an ARM can use?

Maybe - but you'd need to work out what that "something" would be.

And it may just throw up further reliances on AVR-specific stuff.

I have deleted your other cross-post @bitoffmorethanicouldchew.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

I cannot guarantee my cooperation but I will consider it.

Thanks, do you know how I should rewrite the code to allow it to run?

No idea, I'm afraid.

It would likely take some in-depth study of the code.

It would probably be easier to re-write your code from scratch using libraries that are compatible with the Nano 33 BLE ...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.