need some advice on how to make the code smaller
Anubispod
Posts: 42
Hi ,
i need some advice on how to get my code smaller but not slower.
My settings are LMM with -Os size and my stabilizer runs at round 450 loops per sec and thats what i need to keep.
i use some PASM what starts in a new cog and some c loops what run also on other cogs.
Is there a way to mix LMM and CMM like not time important cogs as CMM and Important ones as LMM
or are there any other way to get more space.
extra hardware is out of the question since cmm brings my stbilizer loop down to 70 lps and thats not good enoughf for the pal sized Quad im building.
Here is my code what i have till now , im close to finish but need some more space.
If its not possible then i would go with 2 props on the quad, and share workload and firmware size.
Best regards
Oliver.R
i need some advice on how to get my code smaller but not slower.
My settings are LMM with -Os size and my stabilizer runs at round 450 loops per sec and thats what i need to keep.
i use some PASM what starts in a new cog and some c loops what run also on other cogs.
Is there a way to mix LMM and CMM like not time important cogs as CMM and Important ones as LMM
or are there any other way to get more space.
extra hardware is out of the question since cmm brings my stbilizer loop down to 70 lps and thats not good enoughf for the pal sized Quad im building.
Here is my code what i have till now , im close to finish but need some more space.
If its not possible then i would go with 2 props on the quad, and share workload and firmware size.
Best regards
Oliver.R
rar
60K
Comments
Best regards Oliver. R
I got a few bytes back, does it matter if i decleare a 32 bit ot 8 in size or do they all get anay way stored in 32 bit space ??
I doubt it would make enough of a difference. The FullDuplex driver and the debug calls eats up almost 5000 bytes without modifications. I was able to save 1400 bytes by reorganizing that code a bit. A simple string / char debug function which doesn't use a cog would be pretty simple. I thing we have one laying around.
I looked at that. The program uses cogstart [ i.e. _start_cog_thread ], and there are only two PASM sections.
That's a fair idea. More work of course and at least a 64KB eeprom is necessary. Maybe you could compress the whole image ... Steve runs ducking for cover.
Could you post your code as a .zip file? I don't have a program for the Mac that understands .rar files.
Thanks!
David
i have 64k epprom on my protoboard so i would just need a smale of how its done nad how i get the code in the epprom upper partbevore progarming the main prog
i hope i understand that right ??
4k sound good to me to get them back
I already made some changes and got back down, i have thrown all out what is not needed like cog stop calls and functions.
Im not shure how much more i will need but
it looks promissing so far
RC PPM reciver needs to be implemented 1 cog hope PASM
And some ADC for the batt voltage monitor in the Failsafe loop
Best regards
Oliver R.
I tied where i have them declared uint8_t Txaddress[5] = {231};
but with no luck
uint8_t Txaddress[5] = {231,231,231,231,231};
that gives me a error on compile
Nordic_Demo.h:36:27: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
Create an initialized array separately and add a reference to it in the struct.