Ok, I shall try to get the code up here, but that is where I am stuck:
The flow of the code.
What I want to do:
{ This is FUNCTION 1
Press a button -
Toggle an output
Set a static variable.
EXIT.
If called return value to reflect static variable.
Allow software toggle of state.
}
{ This is a LOOP
Call {function 1} and get return value.
Depending on variable, either display or clear chr() on the screen
Call {functionn 2} annd get return value
Depending on variable, either display or clearn chr() on the screen
}
{ This is function 2
Receive 2 variables. One is a unique number for which other function is calling it, the other is how long the count down is in minutes.
Get minute value from RTC
When called start count down timer
Count down until ZERO.
When called with 0,0 return the number of minutes remaining.
When running, display chr() on screen. When complete, or cancelled, clear chr() from screen
When ZERO, signal to "calling" FUNCTION that it's time is up and TOGGLE the status of it's outputs.
}
Where I am faling over is the inter-function signaling. I can't quite get my head around how to do it.
What I understand is there are 3 calling conditions:
0,0 would return the time left on the countdown.
unique number, minutes would start the countdown running with that many minutes to go. Marking which routine initiated the countdown.
The other possibility is open, but I would guess it would be unique number, 0.
If you think this is confusing, understand that is how I see C at this point in time.