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

show_submenu: fix sed expression #488

Merged
merged 1 commit into from
Mar 13, 2017
Merged

Conversation

cbosdo
Copy link
Contributor

@cbosdo cbosdo commented Mar 13, 2017

The matching parentheses and | in sed expresssions need to be escaped
or sed will consider like normal characters.

Without this fix, make show_submenu was showing lines like this one:

pro.menu.cpu.8MHzatmega328 ATmega328 (3.3V, 8 MHz)

It now properly outputs lines like this:

pro 8MHzatmega328 ATmega328 (3.3V, 8 MHz)

This output is much less misleading to users especially newcomers.

The matching parentheses and | in sed expresssions need to be escaped
or sed will consider like normal characters.

Without this fix, make show_submenu was showing lines like this one:

  pro.menu.cpu.8MHzatmega328    ATmega328 (3.3V, 8 MHz)

It now properly outputs lines like this:

  pro        8MHzatmega328   ATmega328 (3.3V, 8 MHz)

This output is much less misleading to users especially newcomers.
@sej7278
Copy link
Collaborator

sej7278 commented Mar 13, 2017

i'm a bit rusty on this, how do you actually take that output and put it in a Makefile, would it be BOARD_SUB=8MHzatmega328 or would it be VARIANT=8MHzatmega328, also i thought you'd have to use the dotted version?

the only time i've ever used it is more simple cases e.g. a mega2560 without any custom cpu speed stuff:

BOARD_TAG = mega
BOARD_SUB = atmega2560

which computes VARIANT = mega

your PR certainly seems to make show_submenu match show_boards, but i wonder if we could document it better?

it would be nice to have a header for the 3 columns, which i guess are BOARD_TAG, BOARD_SUB and the descriptive name (or 2 for show_boards)

$ ARDUINO_QUIET=1 make show_boards
atmegang            Arduino NG or older
bt                  Arduino BT
chiwawa             Arduino Industrial 101
circuitplay32u4cat  Adafruit Circuit Playground
diecimila           Arduino Duemilanove or Diecimila
esplora             Arduino Esplora
ethernet            Arduino Ethernet
fio                 Arduino Fio
gemma               Arduino Gemma
leonardoeth         Arduino Leonardo ETH
leonardo            Arduino Leonardo
lilypad             LilyPad Arduino
LilyPadUSB          LilyPad Arduino USB
megaADK             Arduino Mega ADK
mega                Arduino/Genuino Mega or Mega 2560
micro               Arduino/Genuino Micro
mini                Arduino Mini
nano                Arduino Nano
one                 Linino One
pro                 Arduino Pro or Pro Mini
robotControl        Arduino Robot Control
robotMotor          Arduino Robot Motor
uno                 Arduino/Genuino Uno
unowifi             Arduino Uno WiFi
yunmini             Arduino Yún Mini
yun                 Arduino Yún

$ ARDUINO_QUIET=1 make show_submenu
atmegang   atmega168       ATmega168
atmegang   atmega8         ATmega8
bt         atmega168       ATmega168
bt         atmega328       ATmega328
diecimila  atmega168       ATmega168
diecimila  atmega328       ATmega328
lilypad    atmega168       ATmega168
lilypad    atmega328       ATmega328
mega       atmega1280      ATmega1280
mega       atmega2560      ATmega2560 (Mega 2560)
mini       atmega168       ATmega168
mini       atmega328       ATmega328
nano       atmega168       ATmega168
nano       atmega328       ATmega328
pro        16MHzatmega168  ATmega168 (5V, 16 MHz)
pro        16MHzatmega328  ATmega328 (5V, 16 MHz)
pro        8MHzatmega168   ATmega168 (3.3V, 8 MHz)
pro        8MHzatmega328   ATmega328 (3.3V, 8 MHz)

@cbosdo
Copy link
Contributor Author

cbosdo commented Mar 13, 2017

i'm a bit rusty on this, how do you actually take that output and put it in a Makefile, would it be BOARD_SUB=8MHzatmega328 or would it be VARIANT=8MHzatmega328, also i thought you'd have to use the dotted version?

That would be something like:

BOARD_TAG = pro
BOARD_SUB = 16MHzatmega328

The rest of Arduino.mk is made with this in mind. Without the BOARD_TAG and BOARD_SUB I couldn't get the proper avrdude baud rate which is computed by this:

AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.speed)

it would be nice to have a header for the 3 columns, which i guess are BOARD_TAG, BOARD_SUB and the descriptive name (or 2 for show_boards)

I agree: it would be nice for users to have headers for those two commands, the current PR just makes it work.

@sej7278 sej7278 merged commit a4e77e4 into sudar:master Mar 13, 2017
@sej7278
Copy link
Collaborator

sej7278 commented Mar 13, 2017

ok thanks, i've merged it now, we can work on headings later

@sudar
Copy link
Owner

sudar commented Mar 13, 2017

@sej7278 Thanks for taking care of this and the other PR's.

@sej7278
Copy link
Collaborator

sej7278 commented Mar 13, 2017

👍

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