diff options
author | Ayke van Laethem <[email protected]> | 2021-09-04 00:55:35 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-09-16 20:13:04 +0200 |
commit | cb147b9475e843a83c2d3f4e7a19858b6cceb3c8 (patch) | |
tree | 1ab33c9b8c2ab3ab2766acc92fae8ec0f5ae9a09 /tools | |
parent | c830f878c6effe3397aea326b5e97f6f63e9457d (diff) | |
download | tinygo-cb147b9475e843a83c2d3f4e7a19858b6cceb3c8.tar.gz tinygo-cb147b9475e843a83c2d3f4e7a19858b6cceb3c8.zip |
esp32c3: add support for this chip
This change adds support for the ESP32-C3, a new chip from Espressif. It
is a RISC-V core so porting was comparatively easy.
Most peripherals are shared with the (original) ESP32 chip, but with
subtle differences. Also, the SVD file I've used gives some
peripherals/registers a different name which makes sharing code harder.
Eventually, when an official SVD file for the ESP32 is released, I
expect that a lot of code can be shared between the two chips.
More information: https://www.espressif.com/en/products/socs/esp32-c3
TODO:
- stack scheduler
- interrupts
- most peripherals (SPI, I2C, PWM, etc)
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gen-device-svd/gen-device-svd.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/gen-device-svd/gen-device-svd.go b/tools/gen-device-svd/gen-device-svd.go index e527be0e4..4bb9e291b 100755 --- a/tools/gen-device-svd/gen-device-svd.go +++ b/tools/gen-device-svd/gen-device-svd.go @@ -428,11 +428,14 @@ func readSVD(path, sourceURL string) (*Device, error) { licenseBlock = regexp.MustCompile(`\s+\n`).ReplaceAllString(licenseBlock, "\n") } + // Remove "-" characters from the device name because such characters cannot + // be used in build tags. Necessary for the ESP32-C3 for example. + nameLower := strings.ReplaceAll(strings.ToLower(device.Name), "-", "") metadata := &Metadata{ File: filepath.Base(path), DescriptorSource: sourceURL, Name: device.Name, - NameLower: strings.ToLower(device.Name), + NameLower: nameLower, Description: strings.TrimSpace(device.Description), LicenseBlock: licenseBlock, } |