Locking ports

Related to the development libraries, released by Curt Binder
Post Reply
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

Pull request created.. I hate git.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

lnevo wrote:Ok need a check on my binary math..I have everything in place just need to verify the following..

OverridePorts = B00110010

RelayMaskOff |= OverridePorts;
RelayMaskOn &= ~OverridePorts;

I think that should do it...

Thanks for the review :)
bump
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Locking ports

Post by binder »

I see you used "OverridePorts" as the variable name. This to me sounds like the ports that you can override. I'm thinking this is the opposite of what you were intending. The ports you specify are the ones that are Locked and not able to be overridden, correct? Or do I have this backwards?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

The principle was that if you Override the ports they can not be masked... the override will block the relaymask.

The idea was to override the user input and only allow the programming of the ports via on/off.

Sorry for the confusing naming... the pull request is already put in and the whole process confuses the hell out of me. Feel free to change the names, functions, whatever.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

How about the math? :)
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Locking ports

Post by binder »

lnevo wrote:How about the math? :)
I "think" it looks correct but Roberto should be able to confirm. I always get confused when looking at the relayon/off masks for some reason.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Locking ports

Post by rimai »

Looks good to me.
Have you tested?
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

Nope :) I can't load my code until I get some additional hardware because I've mode a hundred million changes :) But I put the changes right before the Relay.Write and it all compiles. I'm pretty confident :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Locking ports

Post by lnevo »

Tested. Working :) Sending you a diff patch because me and git have issues!
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Post by binder »

lnevo wrote:Tested. Working :) Sending you a diff patch because me and git have issues!
nice. way to improvise. :mrgreen:
enigma32
Posts: 74
Joined: Fri Apr 26, 2013 11:48 am
Location: Los Angeles and NYC

Re: Locking ports

Post by enigma32 »

<aside>You're not alone... using git is like having my teeth pulled</aside> ;)
Current setup:
60g 24" custom cube (fish and softies right now)
AI Sol Blue, Ecotech MP-10wES
Coralife skimmer
100% customer controller, transitioning to ReefAngel
Post Reply