tracking software revisions

fernando_g

Senior Member
I'm preaching to the converted, so I know everyone here is aware of the utmost importance of properly tracking software revisions.
On the source file itself, I like to add at the very top the revision level, along with the changes done on that revision. Simply done with a multi-line #REM #ENDREM.

But those remarks are not stored into the Picaxe itself. So...what is a proper way to be able to know what is stored inside a Picaxe?

On programs in which a displayed is controlled, or where there is a Sertxd somewhere, it is as simple as adding a command to display that information.

But how about on projects which do not have displays or ways of automatically outputting the information?
What is a clever way to add that info?

I've been thinking of adding a Sertxd, along the required information, on the very first lines of code for ALL programs. Pause a few seconds, then proceed to the main code.
That way, upon startup and if a terminal is attached to the Serout pin, one can read what is there.

Is there any other clever way you can think of?
 

erco

Senior Member
Sure, but don't write any manifestos, as sertxd text burns up PICAXE's tiny internal memory pretty quickly. I'd rather cram working code in there so maybe just send a few characters to ID the code version.
 

inglewoodpete

Senior Member
I add two or three symbols and a line of code in almost every program I write. Here is an example snip:

Code:
[color=Green]'ymbol Version =  1      '02-Mar-2016 2492 bytes Based on Leederville lamps. Disabled i2c + ADC for FITZ Demo
'ymbol Version =  2      '03-Aug-2016 2390 bytes Revised for testing new FITZ Hardware[/color]
[color=Blue]Symbol [/color][color=Black]Version [/color][color=DarkCyan]=  [/color][color=Navy]3      [/color][color=Green]'15-Aug-2016 2136 bytes First version of random numbers + 1024-"degree" circle (untested)
'[/color]
[color=Navy]#PICAXE [/color][color=Black]28X2[/color]
[color=Blue]Symbol [/color][color=Black]Major [/color][color=DarkCyan]= [/color][color=Navy]0               [/color][color=Green]'Part of version revision information: Vers.<Major>.<Version>
'
'<other definitions>
'
'<then, later in the initialisation code>
'
      [/color][color=Blue]SerTxd ([/color][color=Red]" FITZ RGB Controller Vers "[/color][color=Black], #Major, [/color][color=Red]"."[/color][color=Black], #Version, [/color][color=Blue]CR[/color][color=Black], [/color][color=Blue]LF)[/color]
 

techElder

Well-known member
For the 20X2, 28X2, 40X2, I use the #revision directive in my code:

Code:
main:	readrevision b1		; read revision into b1
 

AllyCat

Senior Member
Hi,

IMHO it's always worth putting something in a SERTXD at the very top of a program, as an indicator if/when the program restarts (for whatever reason). A simple version number is better than nothing, or if you're not very methodical (like me) then PE6 allows you to automatically embed the date and/or filename using the ppp_date and ppp_filename variables. But I usually struggle to remember their exact names because they don't appear to be documented anywhere except buried in the Manual2.pdf (page 10).

Personally, I nearly always start my programs with a supply rail voltage check/report using CALIBADC10 (for a resolution around 20mV) or down to around 1mV if I happen to be using subroutines for that resolution anyway. Also, if I were making the PICaxe "work hard" (driving multiple LEDs or relays, etc.), or I wasn't confident that it was wired correctly ;) , then I'd include a chip temperature check/report, which might give a clue that an overload had caused the "reset". There's program code for all of this in the Code Snippetts section, but ask if you can't find it.

Cheers, Alan.
 

premelec

Senior Member
Assuming the programing output pin is not connected to a critical component you can start with a for/next loop dependent on version which flashes an LED on that output telling the version in blinks... whatever works for you... and I wish that #revision would appear for M2 parts... ;-0
 

Hemi345

Senior Member
Like Alan, I sertxd author, ppp_date and ppp_filename at the start of every program I write along with supply voltage for battery powered projects. Author is included in anticipation that my kids will start developing projects soon. :)

I don't bother with major and minor version numbers because i track my code changes with Git and the line that up with ppp_date and ppp_filename
 

fernando_g

Senior Member
All of them excellent comments.

So in a sense, I was thinking along the right track. A Sertxd on the very first line. And indeed, I had figured out that a good way to waste program memory is indiscriminate use of ext.

Thus...........I also like a lot what Inglewoodpete devised: A symbol for the current version which will be Sertxd, accompanied by the accompanying text on the PE which may be as verbose as required.

Thanks all.
 
Top