Suggested minor change for libraries.

Related to the development libraries, released by Curt Binder
Post Reply
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Suggested minor change for libraries.

Post by dedvalson »

I have noticed that a lot of customers have trouble getting the bit masks correct for things like the WaterChangePorts.

Why not add the following block of code to the ReefAngel_Globals.h file

Code: Select all

#define Port8Bit 0x80
#define Port7Bit 0x40
#define Port6Bit 0x20
#define Port5Bit 0x10
#define Port4Bit 0x08
#define Port3Bit 0x04
#define Port2Bit 0x02
#define Port1Bit 0x01
Then people could do

Code: Select all

ReefAngel.WaterChangePorts = Port8Bit | Port4Bit | Port5Bit;
instead of

Code: Select all

ReefAngel.WaterChangePorts = B10011000;
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Suggested minor change for libraries.

Post by rimai »

That's awesome!!!
I love that.
Sometimes the solution is right in front of you, but in your lifetime you would never see it.
Then another person comes along and tells you: "Hey, just do this."
It's like a lightbulb turned on and all seems bright and clear after that.
This is one of those moments for me. It's brilliant :ugeek:
So much easier.
Roberto.
wolfador
Posts: 241
Joined: Sun Sep 04, 2011 9:59 am
Location: Pittsburgh, PA

Re: Suggested minor change for libraries.

Post by wolfador »

rimai wrote:That's awesome!!!
I love that.
Sometimes the solution is right in front of you, but in your lifetime you would never see it.
Then another person comes along and tells you: "Hey, just do this."
It's like a lightbulb turned on and all seems bright and clear after that.
This is one of those moments for me. It's brilliant :ugeek:
So much easier.

lol one of the many wonders of software development. That is why open source works so much better.
John
ReefAngel and ReefAngel-HD developer
If the RA iOS app has helped please consider a donation
Image
Post Reply