Hi Dennis,
I tried on the groups site to edit this post and change what I wrote.
I meant to say both systems _do_not_ place local variables on the heap.  In 
fact I'm not sure that static are placed on the heap since that could cause all 
sorts of fragmentation issues.

The advantage of static is you can have 
void
RunTimeDisplayThread(void) {
static int32 spc = 0;

The map file shows it as static in the data area
spc   0x0001d8       data     static P:\ELeadscrew\PIC18Code\src\ELeadscrew.c

Which means it's initialized in the startup file along with all the other 
globals.  The difference between globals and the statics is the statics are 
private and not accessible outside the function.


> 
>       Something else to consider -- alignment. C compilers may add padding
> between elements to match some architecture idea of ease-of-access (on a
> four-byte alignment, a single byte/char field will have three bytes of
> padding added to put following data on a 4-byte increment). cf the avabodh
> page.

It's a good point you make there.  However then the SizeOf function might well 
return something different in size to make everything fit.  I've also heard of 
systems re-arranging the members of a record to suit.  In pascal to make that 
happen you defined it as packed.  

Now that I know the solution I'll take some time and capture what the memory 
looks like with and without the FillByte function.

> 
> 
> >BTW.  For the Pi to make this work I have to either run it with sudo from 
> >the command line or run Lazarus with sudo.  The help
> everyone provided on the Beagle  to make my user part of the gpio group means 
> the code can run and be debugged from within the
> IDE.
> 
>       Sounds like the R-Pi may not have set the same group memberships.
> Though mine seems to have gpio and spi set...
> 
> pi@rpi3bplus-1:~$ groups
> pi adm dialout cdrom sudo audio video plugdev games users input netdev
> lpadmin gpio i2c spi
> pi@rpi3bplus-1:~$

This one has this:
pi@raspberrypi:~/projects/lazarus/TC $ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev lpadmin 
gpio i2c spi

To blink the LED the python program doesn't need sudo.  Which makes sense given 
the groups.

Because this example program uses the high speed gpio the fault happens much 
sooner on the Pi without the sudo.

pi@raspberrypi:~/projects/lazarus/TC $ ./TC
An unhandled exception occurred at $00084EE4:
                                             ERPiOpenFile: Cannot not open file 
</dev/mem> for memory mapping.
                                $00084EE4  TFASTSYSTEMCORE__CREATE,  line 451 
of /home/pi/projects/lazarus/pxl/Source/PXL.Boards.RPi.pas
                                                          $00010410  main,  
line 95 of TC.lpr

I'll build that project on the Beagle and see what happens.
John

> --
> Dennis L Bieber
> 
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/ra9rag5p83r4p3kgl8bmt19u9asiipd5b9%404ax.com.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/02ae01d751d5%243162c740%24942855c0%24%40autoartisans.com.

Reply via email to