Hi Richard,
I started writing a reply based on the previous files you posted, in which I found what looked to me quite substantial differences but now you've changed them so I'm just going to ask instead.
Are all three versions functionally equivalent, ie. are they doing exactly the same thing?
It still looks to me as if there are functional differences between the C version and the PBP version - I'm only comparing the versions for PIC, haven't looked at the Arduino code. It's my understandning that the follwing two snippets should be functionally equivallent:
C-version:PBP-version:Code:while (1){ if (d_mode) pins_on=va+vb; else pins_on=vc+vd ; for (x=0;x<5;x++){ latc = latc | pins_on ; delay_ms(200); latc = latc & all_off ; delay_ms(200); } if (!d_mode) shuffle(); d_mode= !d_mode; }In the C version there's a d_mode variable which you're checking, I don't see that in the PBP version - what am I missing. (I truly suck at reading C code!)Code:action: pins_on=a+b for x = 1 to 5 latC = latC | pins_on pause 200 latC = latC & all_off pause 200 next x gosub shuffle goto action
It won't have an impact on the Interrupt latency (at least not for PBP) but if we're comparing compiles size we're going to have to make the code as functionally equal as possible or the results won't say much, no matter which way it swings.
/Henrik.




Bookmarks