Open-CMSIS-Pack / Open-CMSIS-Pack-Spec

Common Microcontroller Software Interface Standard - Pack(age) based distribution system
https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/
Apache License 2.0
53 stars 21 forks source link

Extend Config Wizard with a way to enter symbols or values #302

Closed ReinhardKeil closed 5 months ago

ReinhardKeil commented 5 months ago

https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/configWizard.html specifies s to enter strings.

There should be also a way to enter symbol or value names (basically the same as strings, but without the surrounding quotes ". Adding <y> as another item.

The use case is for example a CMSIS-Driver number that is either defined as plain value (0, 1, 2) or as #define symbol that comes from a different header file.

thorstendb-ARM commented 5 months ago

I'd suggest to allow numbers and values on y tag, but no portions of numbers as they are possible on o tag (e.g. <o.1> or <o.1..4>).

To handle the case if the user does not enter a symbol or value (entry deleted), we should stop scanning for possible values at the line ending (as proposed by @ReinhardKeil ). This breaks with the overal rule in ConfigWizard and will not allow to put the value on the next line, but should work in general.

Currently supported:

//   <y>Value or Define Symbol that specifies number of open files <1-16>
//   <i>Define number of files that can be opened at the same time.
//   <i>Default: 4
#define FAT_MAX_OPEN_FILES      maxFiles

//   <y>Minimum number of open files <1-16>
//   <i>Define number of files that can be opened at the same time.
//   <i>Default: 4
//   <y1>Maximum number of open files <1-16>
//   <i>Define number of files that can be opened at the same time.
//   <i>Default: 4
#define FAT_MAX_OPEN_FILES      (minFiles, maxFiles)

//   <y FAT_MAX_OPEN_FILES>Value or Define Symbol that specifies number of open files <1-16>
//   <i>Define number of files that can be opened at the same time.
//   <i>Default: 4
#define FAT_MAX_OPEN_FILES      maxFiles2

Known issues:

ReinhardKeil commented 5 months ago

Thorsten, we just need one symbol per line. Therefore I would use a <newline> as delimiter. There is currently no requirement to support a list of identifiers, the 2nd case in your example above needs not to be supported.