Re: It Builds! (Re: Building from the source files. Library location.)

Dave_G0WBX
 

OK Gary.

I renamed the Aidafruit GLCD library, and copied in the specific one for the Antuino.

The search path pattern on Windows is somewhat different I think to how it works on Linux, but point taken.  I'm sure that will be of use to others.

Anyway.  The project built OK (this time, on the shack PC, also Mint 19.2, with the 1.8.10 Arduino IDE.)

With breath held, I connected the cable, checked that the device showed up, told the IDE the port (and still specifying the use of the old bootloader) and selected "Sketch, Upload".

During the upload process, part of the display gets corrupted, but once the upload has ended and the Nano restarted, it's business as usual!.

So, I did it again, after changing the Title line to have my call-sign showing (instead of "Antuino") more to prove to myself that this all works, than for any plagiarism.  (I also changed the version to v2.1x.)

That is set in the 'gui' module:-  Line 506 onwards.


void updateScreen(){

  // draw the title bar
//  strcpy(b, "#Antuino - ");
  strcpy(b, "# G8KBV - ");

  GLCD.ClearScreen();
  switch (mode){
    case MODE_ANTENNA_ANALYZER:
      strcat(b, "SWR");
      break;
    case MODE_MEASUREMENT_RX:
      strcat(b, "PWR");
      break;
    case MODE_NETWORK_ANALYZER:
     strcat(b, "SNA");
     break;
  }

//  strcat(b, "   v2.1");
  strcat(b, "  v2.1x");


As you can see, the original versions are still there for later.  Anyway, again, it built and uploaded just fine.

I'm happy, now I can play and see what I can do with the SWR plot etc.   Still lots to read and learn, but that's the fun part.

Thanks to everyone for the invaluable help and advice.

73.

Dave G0WBX.


On 24/10/2019 18:55, Garry48 wrote:
Dave G8KBV,

Reference:

>One more question, re the glcd library used here.  Does the file 'ks0108_Arduino.h' "Need" to be in the glcd lib' folder, or as it is an included file within the >sketch, and sketch folder, will the configuration be picked up from there?

The file 'ks0108_Arduino.h' should be placed in the glcd/include subdirectory.  It is code specific to the glcd library.  Mr. Farhan should have already re-compiled the glcd library. Dependencies in the glcd library should cause it to be re-compiled it any changes are made to the files that build the glcd library. At least that is what should happen.

When compiling and linking there is an order to the search paths.  Here is the gcld example:

ResolveLibrary(glcd.h)
  -> candidates: [glcd]
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Users\\MyUser\\Documents\\Arduino\\Sketches\\libraries\\glcd" "C:\\Users\\MyUser\\AppData\\Local\\Temp\\arduino_build_976861\\sketch\\antenna_analyzer_p3.ino.cpp" -o nul

The include paths are defined as follow using the -I directive:

"-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino"

"-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs"

"-IC:\\Users\\MyUser\\Documents\\Arduino\\Sketches\\libraries\\glcd"

So to get glcd built properly, the 'ks0108_Arduino.h' file should be placed in the glcd subdirectory structure.  Since there is an include subdirectory, I dropped it in with all of the other include files.  Somehow the compiler & linker knows how to find it; since it compiles and links without errors.

>Related:  If I should use that library for other projects, using 'standard' interconnections, is that "modified" library OK for that, or should I use the Adafuit >version from the IDE download site?   If so, how best to keep them segregated?

The glcd library was included in the antuino 2.1 sketch 'only'! It is not available for any other sketches you may compile.  My suggestion is to use the library manager (TOOLS ->  MANAGE LIBRARIES) and install the 'latest distribution' glcd or lcd library for the display you are using.  This insures you are NOT using an outdated/modified library (in this case the glcd included in the Antuino archive).  Using old or modified libraries will cause you hours of chasing/hunting 'undefined symbols, routines', etc!  It is not worth the effort!

Yes, keep them segregated!  The worst thing you can do is mix two versions together.  Ultimately you will end up erasing both and downloading them again (or extracting them out of your configuration management system) and recompiling/linking.

HTH

Garry / WD0DUD, Ex real-time Lead Software Engineer (Flight Simulation)




-- 
Created on and sent from a Unix like PC running and using free and open source software:

Join Antuino@groups.io to automatically receive all group messages.