Documentation ¶
Overview ¶
Package id List is responsible for id List managing
Package id List is responsible for id List managing ¶
Package id List is responsible for id List managing
Index ¶
- Variables
- func ConditionalFilePath(fn string) string
- func ScZero(w io.Writer, SrcZ string, cmd *flag.FlagSet) error
- func ScZeroMulti(w io.Writer, cmd *flag.FlagSet) error
- func SubCmdReNewList(w io.Writer) (err error)
- func SubCmdRefreshList(w io.Writer) (err error)
- func SubCmdUpdate(w io.Writer) error
- type TriceFmt
- type TriceID
- type TriceIDLookUp
- type TriceIDLookUpLI
- type TriceLI
Constants ¶
This section is empty.
Variables ¶
var ( ExtendMacrosWithParamCount bool // DefaultTriceBitWidth tells the bit width of TRICE macros having no bit width in their names, like TRICE32 or TRICE8. // // One target can use only one bith width for bare TRICE macros and the setting inside the target code must match DefaultTriceBitWidth. DefaultTriceBitWidth = "32" // todo: create compiler switch for other options "8", "16", "32", "64" )
var ( // Verbose gives more information on output if set. The value is injected from main packages. Verbose bool // DryRun if set, inhibits real changes DryRun bool // FnJSON is the filename for the JSON formatted ID list. FnJSON string // LIFnJSON is the filename for the JSON formatted location information list. LIFnJSON string // Min is the smallest allowed ID for normal trices. Min = TriceID(10000) // Max is the biggest allowed ID for normal trices. Max = TriceID(16000) // SearchMethod is the next ID search method. SearchMethod = "random" // SharedIDs false: TriceFmt's without TriceID get a different TriceID if an equal TriceFmt exists already (default). SharedIDs bool )
var (
// Srcs gets multiple files or directories.
Srcs arrayFlag
)
Functions ¶
func ConditionalFilePath ¶ added in v0.10.0
ConditionalFilePath returns absolute file path if fn is not "off" or "none".
func ScZeroMulti ¶ added in v0.55.1
ScZero does replace all ID's in source tree with 0
func SubCmdReNewList ¶ added in v0.18.4
SubCmdReNewList renews the trice id list parsing the source tree without changing any source file. It creates a new FnJSON and tries to add id:tf pairs from the source tree. If equal tf are found with different ids they are all added. If the same id is found with different tf only one is added. The others are reported as warning. If any TRICE* is found without Id(n) or with Id(0), it is ignored. SubCmdUpdate needs to know which IDs are used in the source tree, to reliably add new IDs.
func SubCmdRefreshList ¶ added in v0.18.4
SubCmdRefreshList refreshes the trice id list parsing the source tree without changing any source file. It only reads FnJSON and tries to add id:tf pairs from the source tree. If equal tf are found with different ids they are all added. If the same id is found with different tf only one is added. The others are reported as warning. If any TRICE* is found without Id(n) or with Id(0), it is ignored. SubCmdUpdate needs to know which IDs are used in the source tree, to reliably add new IDs.
func SubCmdUpdate ¶ added in v0.18.4
SubCmdUpdate is sub-command update
Types ¶
type TriceFmt ¶ added in v0.18.4
type TriceFmt struct { Type string `json:"Type"` // format type (bit-size and number of fmt string parameters) Strg string `json:"Strg"` // format string }
TriceFmt is the trice format information assigned to a trice ID.
type TriceID ¶ added in v0.18.4
type TriceID int
TriceID is the trice ID referencing to Fmt.
type TriceIDLookUp ¶ added in v0.18.4
TriceIDLookUp is the ID-to-TriceFmt info translation map. Different IDs can refer to equal TriceFmt's. It is used during logging. Example: 1:A, 5:C, 7:C An ID can point to one and only format string.
func NewLut ¶ added in v0.18.4
func NewLut(w io.Writer, fn string) TriceIDLookUp
NewLut returns a look-up map generated from JSON map file named fn.
func (TriceIDLookUp) AddFmtCount ¶ added in v0.26.0
func (lu TriceIDLookUp) AddFmtCount(w io.Writer)
AddFmtCount adds inside lu to all trice type names without format specifier count the appropriate count. example change: `map[10000:{Trice8_2 hi %03u, %5x} 10001:{TRICE16 hi %03u, %5x}] `map[10000:{Trice8_2 hi %03u, %5x} 10001:{TRICE16_2 hi %03u, %5x}]
func (TriceIDLookUp) FileWatcher ¶ added in v0.18.4
func (lu TriceIDLookUp) FileWatcher(w io.Writer, m *sync.RWMutex)
FileWatcher checks the id list file for changes. taken from https://medium.com/@skdomino/watch-this-file-watching-in-go-5b5a247cf71f
func (TriceIDLookUp) FromJSON ¶ added in v0.18.4
func (lu TriceIDLookUp) FromJSON(b []byte) (err error)
FromJSON converts JSON byte slice to lu.
type TriceIDLookUpLI ¶ added in v0.53.0
func NewLutLI ¶ added in v0.53.0
func NewLutLI(w io.Writer, fn string) TriceIDLookUpLI
NewLutLI returns a look-up map generated from JSON map file named fn.
func (TriceIDLookUpLI) FileWatcher ¶ added in v0.53.0
func (li TriceIDLookUpLI) FileWatcher(w io.Writer)
FileWatcher checks the id location information file for changes. taken from https://medium.com/@skdomino/watch-this-file-watching-in-go-5b5a247cf71f
func (TriceIDLookUpLI) FromJSON ¶ added in v0.53.0
func (li TriceIDLookUpLI) FromJSON(b []byte) (err error)
FromJSON converts JSON byte slice to li.