Skip to content

Commit

Permalink
Merge #885
Browse files Browse the repository at this point in the history
885: Convert `launch.json` properties to camelCase r=Yatekii a=noppej

*Note:* The changes in this PR is dependent on being synchronized with [probe-rs/vscode PR #21](probe-rs/vscode#21)

*Changes*
* Convert all existing `launch.json` properties to camelCase
* Updates to CHANGELOG

Co-authored-by: JackN <noppej@hotmail.com>
  • Loading branch information
bors[bot] and noppej committed Nov 12, 2021
2 parents 841c27d + 2841c58 commit 545267b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Increased default RTT Timeout (retry waiting for RTT Control Block initialization) to 1000ms in `probe-rs-debugger`. (#847)
- Improved when RTT is initialized/retried, and removed `rtt_timeout` from recognized options of `probe-rs-debugger`. (#850)
- Refactor `probe-rs-debugger` code as per `launch` vs. `attach` changes documented in [VS Code extension PR # 12](https://github.com/probe-rs/vscode/pull/12) (#854)
- Breaking change: `probe-rs-debugger` and the associated [VSCode extension PR #21](https://github.com/probe-rs/vscode/pull/21) now uses camelCase for all `launch.json` properties (#885)

### Fixed
- Detect proper USB HID interface to use for CMSIS-DAP v1 probes. Without this, CMSIS-DAP probes with multiple HID interfaces, e.g. MCUlink, were not working properly on MacOS (#722).
Expand Down
2 changes: 2 additions & 0 deletions debugger/src/dap_types.rs
Expand Up @@ -25,13 +25,15 @@ pub struct QuitRequest {
}

#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RttChannelEventBody {
pub channel_number: usize,
pub channel_name: String,
pub data_format: crate::rtt::DataFormat,
}

#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RttDataEventBody {
pub channel_number: usize,
/// RTT output
Expand Down
1 change: 1 addition & 0 deletions debugger/src/debugger.rs
Expand Up @@ -90,6 +90,7 @@ impl std::str::FromStr for TargetSessionType {

/// Shared options for all commands which use a specific probe
#[derive(StructOpt, Clone, Deserialize, Debug, Default)]
#[serde(rename_all = "camelCase")]
pub struct DebuggerOptions {
/// Will be set when the DAP client issues a `launch` or `attach` request
#[structopt(long, requires("dap"))]
Expand Down
5 changes: 3 additions & 2 deletions debugger/src/rtt.rs
Expand Up @@ -50,16 +50,17 @@ impl Default for DataFormat {
#[derive(StructOpt, Debug, Clone, Deserialize, Default)]
pub struct RttConfig {
#[structopt(skip)]
#[serde(default, rename = "rtt_enabled")]
#[serde(default, rename = "rttEnabled")]
pub enabled: bool,
/// Configure data_format and show_timestamps for select channels
#[structopt(skip)]
#[serde(default = "default_channel_formats", rename = "rtt_channel_formats")]
#[serde(default = "default_channel_formats", rename = "rttChannelFormats")]
pub channels: Vec<RttChannelConfig>,
}

/// The User specified configuration for each active RTT Channel. The configuration is passed via a DAP Client configuration (`launch.json`). If no configuration is specified, the defaults will be `Dataformat::String` and `show_timestamps=false`.
#[derive(StructOpt, Debug, Clone, serde::Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RttChannelConfig {
pub channel_number: Option<usize>,
pub channel_name: Option<String>,
Expand Down

0 comments on commit 545267b

Please sign in to comment.