¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

freeMemory()


 

Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

jack -- you can DISABLE the jams that I put in to keep the bmp working no matter what -- and then it will FAIL and from then on will no longer use the BMP sensor.? ?That will allow you to run the code without problems.? ?
Gordon


On Thu, Apr 16, 2020 at 10:45 AM jjpurdum via <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

I suggest that we immediately start using github. It is the only way to NOT wait for each other to finish the code.
Take a break for 20 minutes and watch this


On Thu 16 Apr, 2020, 8:15 PM jjpurdum via , <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

Yes, I saw that, but I still would not be able to get meaningful trials of anything in the system, other than exercising the menus. Also, the runtime memory use for data would likely be different than the "real" thing.

Jack, W8TEE

On Thursday, April 16, 2020, 11:04:12 AM EDT, Gordon Gibby <docvacuumtubes@...> wrote:


jack -- you can DISABLE the jams that I put in to keep the bmp working no matter what -- and then it will FAIL and from then on will no longer use the BMP sensor.? ?That will allow you to run the code without problems.? ?
Gordon


On Thu, Apr 16, 2020 at 10:45 AM jjpurdum via <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

That's fine, but I don't think we want the production version to include the runtime free memory checks in it, do we? If we do, then I would suggest wrapping all of its code in #ifdef DEBUG preprocessor directives.

Jack, W8TEE

On Thursday, April 16, 2020, 11:07:37 AM EDT, Ashhar Farhan <farhanbox@...> wrote:


I suggest that we immediately start using github. It is the only way to NOT wait for each other to finish the code.
Take a break for 20 minutes and watch this


On Thu 16 Apr, 2020, 8:15 PM jjpurdum via , <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

will do.? Thanks ashar!
See elsewhere:? ?I have the assist?working better


On Thu, Apr 16, 2020 at 11:07 AM Ashhar Farhan <farhanbox@...> wrote:
I suggest that we immediately start using github. It is the only way to NOT wait for each other to finish the code.
Take a break for 20 minutes and watch this


On Thu 16 Apr, 2020, 8:15 PM jjpurdum via , <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

OK,? I'm? **so** dumb I had to drop back to his EARLIER video for beginners but I have a graphical version of git now running on my windows computer.? ?Made it through 3 minutes of the first video.? ?Probalbyl going to quit for lunch soon and come back.? ?I'll get this figured out!

Next goal is some sort of functional test of both Marcelo and "simple" code today.? ?I want to give Marcelo a written list of what I see and also evaluate "simple" code.??

Jack -- My choice of the FCN button to initiate the two-button sequences was poor.? Because if you don't play piano well, you often end up just getting an 8 second vent-pause and recalibrate.? ?Can youo do that better?? ?Perhaps use a different button as the 1st button of the sequence????? Or you and Ashhar do something even much better?? ?

We need additional inputs now
ASSIST ON
ASSIST OFF
need to exist within the user-nterface?with the buttons.? ?A two-button sequence starting with another different button is possible, or holding a button, --- whatever you wish.? ? I just did the 2-buttons because I was capable of programming that.

I think we are very close to the LAST of the features on the 2-line display.? ?For anything more than that, we'll need a 4 line display.? ?I have one, and hope to have it working by tomorrow morning......on something.? ??

But for now I'll work on the github education.?


Gordon


On Thu, Apr 16, 2020 at 11:07 AM Ashhar Farhan <farhanbox@...> wrote:
I suggest that we immediately start using github. It is the only way to NOT wait for each other to finish the code.
Take a break for 20 minutes and watch this


On Thu 16 Apr, 2020, 8:15 PM jjpurdum via , <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE


 

OK.? So after watching and testing several little files with notepad and with Arduino IDE I now have an idea how to operate

GIT

using a graphical user interface version that appeared in my list of programs and is more to my style of life than the command line.? ?I was able to create a couople of branches and discovered that when I checked them out, the right stuff magicallly appeared back in the directory,, for either notepad OR? the Arduino IDE to see.? ?So pretty cool.? ? I did not try to "merge" anyghing (have no idea how that could happen, yet).

NOW will start looking at the Github video that Ashhar recommended.....? ?Meanwhile, further progress has been made at UF on a front or two....
And I mesured the resonances of the half wave end fed that i put up yesterd and looks "usable".
I'll get there!

Gordon