Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free RAM on IO #7165

Closed
wants to merge 3 commits into from
Closed

Free RAM on IO #7165

wants to merge 3 commits into from

Conversation

LorenzMeier
Copy link
Member

@LorenzMeier LorenzMeier commented May 1, 2017

This saves about 1K of RAM on IO, bringing it back to the comfort zone (below with a 4-output mixer on fixed wing loaded).

Fix for #7142 .

@NaterGator Can you review / test?

WARN  [px4io] loaded
protocol 4 hardware 2 bootloader 3 buffer 64B crc 0x53a82816
8 controls 8 actuators 18 R/C inputs 2 analog inputs 0 relays
1128 bytes free
status 0x0f00 SAFETY_SAFE RC_FAIL FMU_FAIL MIXER_OK ARM_SYNC INIT_OK FAILSAFE
alarms 0x0030 FMU_LOST RC_LOST
vservo 106 mV vservo scale 10000
vrssi 1449
actuators 0 0 0 -10000 -25000 -25000 -25000 -25000
servos 1500 1500 1500 900 0 0 0 0
reversed outputs: [________] trims: r:   0.0000 p:   0.0000 y:   0.0000
0 raw R/C inputs
R/C flags: 0x0000
mapped R/C inputs 0x0000
ADC inputs 46 1830
features 0x0008 RSSI_ADC
arming 0x0434 FMU_DISARMED IO_ARM_DENIED MANUAL_OVERRIDE_OK INAIR_RESTART_OK ALWAYS_PWM_ENABLE OVERRIDE_IMMEDIATE
rates 0x0000 default 50 alt 400 sbus 72
debuglevel 0
controls 0: 0 0 0 0 0 0 0 0
controls 1: 0 0 0 0 0 0 0 0
controls 2: 0 0 0 0 0 0 0 0
controls 3: 0 0 0 0 0 0 0 0
input 0 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 1 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 2 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 3 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 4 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 5 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 6 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 7 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000
input 8 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 9 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 10 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 11 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 12 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 13 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 14 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 15 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 16 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
input 17 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000
failsafe 1500 1500 1500 900 0 0 0 0
disarmed values 0 0 0 1000 0 0 0 0

@LorenzMeier LorenzMeier requested review from dagar and davids5 May 1, 2017 15:37
This avoids burning significant memory in a configuration that is not actually using parallel tasks
@LorenzMeier
Copy link
Member Author

The decode tests fail as they have hardcoded failure counts and with different memory contents on start they arrive at different results. I need to validate if this is a bad test or if this is an issue for the decoder and I need to reset when the decoder is given the buffer.

@NaterGator
Copy link
Contributor

Will be happy to test. I also implemented mixer loading from the FMU with dynamic memory that is managed during the mixer loading process which got me over the hill. I'll see about rebasing if / when this PR goes in.

@LorenzMeier
Copy link
Member Author

There are definitely a few things incorrect here in the parsers. Some uses of sizeof() were against the array and are now against pointers. Trying to solve this with minimal changes with references, otherwise I'll have to re-audit the whole parser code for every operation.

@davids5 davids5 mentioned this pull request May 2, 2017
@davids5
Copy link
Member

davids5 commented May 2, 2017

@NaterGator, @LorenzMeier Refactored here #7167

@LorenzMeier
Copy link
Member Author

This is the better version of it: #7167

@LorenzMeier LorenzMeier closed this May 2, 2017
@LorenzMeier LorenzMeier deleted the pr-io-free-ram branch May 2, 2017 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants