Notifications
Clear all

anyone know where these aew defined?

7 Posts
3 Users
0 Reactions
163 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8015
Topic starter  

Does anyone know where the following are defined?

ARDUINO_AVR_UNO
ARDUINO_AVR_MEGA2560
ARDUINO_SAMD_MKR1000
and others.
 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
Quote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 6 years ago
Posts: 1119
 

Hi Ron

If you are talking about where macros are defined within the Arduino IDE, they are usually in the boards.txt or platform.local.txt files.  See this link for more details.

There will be separate files for each boards manager(i.e., both Arduino AVR and ESP32 boards will have their own file).

Or perhaps I misinterpreted your question?

😎

Bill

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8015
Topic starter  

@dronebot-workshop I did not see them in the boards.txt, and couldn't locate the platform.local.txt. I already did a search of the entire dir tree packages for both .h and .txt with no luck. My suspicion is it is in the highest level and is precompiled so not easily searchable.

The reason I am asking is I am trying to 'detect' what board family is being used in a sketch. The most trivial use is knowing when !Serial will work or not.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 7 months ago
Posts: 266
 

@dronebot-workshop 

Is it just me or is this build process convoluted? I recall trying to understand it in detail back when I was learning the Arduino command line processor but gave up when I encountered the list of include paths for the compiler (4 pages of path names; just wall-to-wall text!)

@zander,

Anyway, if I read this documentation correctly, from the programmatic POV, the constants should be considered pre-built, compiler constants, i.e., not defined in any file.

The one who has the most fun, wins!


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8015
Topic starter  

@tfmccarthy I agree, I did a comprehensive search and they are not in any .h or .txt file. I understand your observation, but you likely have the same general experience as I do. We worked in relatively simple environments, the Arduino IDE/CLI has to support quite a few Arduino boards, and the Espressif boards, plus I have 6 more families so it will be complex. I understand how it works, it's not a mystery, I did something similar at IBM but that was 1/10 as complex or less compared to the Arduino universe.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 7 months ago
Posts: 266
 

@zander 

It's still a cross compiler.

The same situation existed when Thompson and Richie developed the C compiler. They were able to encapsulate the hardware in the small compiler backend and port the rest of the compiler to the development platform. So today my compiler can generate code for a variety of target hardware platforms (x86, 64, ARM, etc.)

Admittedly, my experience with cross compilers was for a specific target hardware whereas the Arduino IDE supports dozens. It's just disconcerting to have what I've always thought of as a "standard" file moving around the hard drive because I update the compiler version. And the sheer number of platform specific files is mind boggling.

The one who has the most fun, wins!


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8015
Topic starter  

@tfmccarthy I think Gnu C and C++ were cross compiers from almost the beginning. A platform I worked on had not just the compilers that way but also the OS. It was a 3 layer cake, for the compilers, a language specific front end (C, PL1, Cobol, Basic, Fortran and maybe a few I forgot), a middle layer that was the real compiler then the backend that converted it to the platform. While I worked there, we had Motorola 68000, then HP, then Intel. We ported everything overnight without a single hiccup every time. It also meant that no one language was 'faster' than another in any significant way.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote