-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to ensure that we don't reset current_time drivers
- Loading branch information
Showing
5 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::{error::Error, str::FromStr}; | ||
|
||
use esp_build::assert_unique_used_features; | ||
use esp_metadata::{Chip, Config}; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
// NOTE: update when adding new device support! | ||
// Ensure that exactly one chip has been specified: | ||
assert_unique_used_features!( | ||
"esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3" | ||
); | ||
|
||
// NOTE: update when adding new device support! | ||
// Determine the name of the configured device: | ||
let device_name = if cfg!(feature = "esp32") { | ||
"esp32" | ||
} else if cfg!(feature = "esp32c2") { | ||
"esp32c2" | ||
} else if cfg!(feature = "esp32c3") { | ||
"esp32c3" | ||
} else if cfg!(feature = "esp32c6") { | ||
"esp32c6" | ||
} else if cfg!(feature = "esp32h2") { | ||
"esp32h2" | ||
} else if cfg!(feature = "esp32s2") { | ||
"esp32s2" | ||
} else if cfg!(feature = "esp32s3") { | ||
"esp32s3" | ||
} else { | ||
unreachable!() // We've confirmed exactly one known device was selected | ||
}; | ||
|
||
// Load the configuration file for the configured device: | ||
let chip = Chip::from_str(device_name)?; | ||
let config = Config::for_chip(&chip); | ||
|
||
// Define all necessary configuration symbols for the configured device: | ||
config.define_symbols(); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters