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

Add new/missing defmt log format options #90

Merged
merged 7 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
// Enable prettier format on save
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": false
"editor.formatOnPaste": false,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
74 changes: 60 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@
"debuggers": [
{
"type": "probe-rs-debug",
"label": "Debug adapter on top of probe-rs",
"label": "probe-rs Debugger",
"languages": [
"rust"
"rust",
"c"
],
"configurationAttributes": {
"launch": {
Expand Down Expand Up @@ -214,6 +215,7 @@
},
"flashingConfig": {
"type": "object",
"additionalProperties": false,
"description": "These options are applied when flashing one or more `program_binary` files to the target memory.",
"properties": {
"flashingEnabled": {
Expand All @@ -238,6 +240,7 @@
},
"formatOptions": {
"type": "object",
"additionalProperties": false,
"properties": {
"binaryFormat": {
"type": "string",
Expand Down Expand Up @@ -281,6 +284,7 @@
"description": "Each MCU core has a mandatory `programBinary` as well as several other optional properties.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"programBinary"
],
Expand All @@ -296,7 +300,7 @@
},
"svdFile": {
"type": "string",
"description": "The path (relative to `cwd` or absolute) to the CMCIS-SVD file for your target core"
"description": "The path (relative to `cwd` or absolute) to the CMSIS-SVD file for your target core"
},
"rttEnabled": {
"type": "boolean",
Expand All @@ -305,12 +309,16 @@
},
"rttChannelFormats": {
"type": "array",
"description": "RTT channel configuration. Unlisted active channels will be configured with `dataFormat=String', and 'showTimestamps=true'.",
"items": {
"type": "object",
"required": [
"channelNumber"
],
"properties": {
"channelNumber": {
"type": "number",
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `dataFormat=String', and 'showTimestamps=false'."
"description": "The channel number to which this data format applies."
},
"dataFormat": {
"type": "string",
Expand All @@ -323,19 +331,35 @@
"enumDescriptions": [
"String (text) format.",
"Binary Little Endian format.",
"Deferred formatting (see: https://defmt.ferrous-systems.com)."
"defmt (see: https://defmt.ferrous-systems.com)."
],
"default": "String"
},
"mode": {
"type": "string",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just hoping here that omitting this will result in None on the Rust side...

"description": "RTT operating mode.",
"enum": [
"NoBlockSkip",
"NoBlockTrim",
"BlockIfFull"
],
"enumDescriptions": [
"The target will add data to the channel only if it fits completely, otherwise it will skip the data.",
"The target will add as much data to the channel as possible, without blocking.",
"The target will block until there is enough space in the channel to add the data."
]
},
"showTimestamps": {
"type": "boolean",
"default": false,
"description": "Enable the inclusion of timestamps in the RTT output for `dataFormat=String`."
},
"showLocation": {
"type": "boolean",
"default": true,
"description": "Enable the inclusion of Defmt location information in the RTT output for `dataFormat=Defmt`."
"description": "Enable the inclusion of defmt location information in the RTT output for `dataFormat=Defmt`."
},
"logFormat": {
"type": "string",
"description": "The default format string to use for decoding defmt logs."
}
}
}
Expand Down Expand Up @@ -450,6 +474,7 @@
"description": "Each MCU core has a mandatory `programBinary` as well as several other optional properties.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"required": [
"programBinary"
Expand All @@ -465,7 +490,7 @@
},
"svdFile": {
"type": "string",
"description": "The path (relative to `cwd` or absolute) to the CMCIS-SVD file for your target core"
"description": "The path (relative to `cwd` or absolute) to the CMSIS-SVD file for your target core"
},
"rttEnabled": {
"type": "boolean",
Expand All @@ -474,12 +499,17 @@
},
"rttChannelFormats": {
"type": "array",
"description": "RTT channel configuration. Unlisted active channels will be configured with `dataFormat=String', and 'showTimestamps=true'.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"channelNumber"
],
"properties": {
"channelNumber": {
"type": "number",
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `dataFormat=String', and 'showTimestamps=false'."
"description": "The channel number to which this data format applies."
},
"dataFormat": {
"type": "string",
Expand All @@ -492,19 +522,35 @@
"enumDescriptions": [
"String (text) format.",
"Binary Little Endian format.",
"Deferred formatting (see: https://defmt.ferrous-systems.com)."
"defmt (see: https://defmt.ferrous-systems.com)."
],
"default": "String"
},
"mode": {
"type": "string",
"description": "RTT operating mode.",
"enum": [
"NoBlockSkip",
"NoBlockTrim",
"BlockIfFull"
],
"enumDescriptions": [
"The target will add data to the channel only if it fits completely, otherwise it will skip the data.",
"The target will add as much data to the channel as possible, without blocking.",
"The target will block until there is enough space in the channel to add the data."
]
},
"showTimestamps": {
"type": "boolean",
"default": false,
"description": "Enable the inclusion of timestamps in the RTT output for `dataFormat=String`."
},
"showLocation": {
"type": "boolean",
"default": true,
"description": "Enable the inclusion of Defmt location information in the RTT output for `dataFormat=Defmt`."
"description": "Enable the inclusion of defmt location information in the RTT output for `dataFormat=Defmt`."
},
"logFormat": {
"type": "string",
"description": "The default format string to use for decoding defmt logs."
}
}
}
Expand Down
Loading