Skip to content

Commit 0caf5dc

Browse files
committed
formatting
1 parent 7abb93a commit 0caf5dc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

esp32-led-blink-sdk/main/Led.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct Led {
2323
fatalError("cannot reset led")
2424
}
2525
}
26-
func setLed(value:Bool) {
26+
func setLed(value: Bool) {
2727
let level: UInt32 = value ? 1 : 0
2828
gpio_set_level(ledPin, level)
2929
}

esp32-led-blink-sdk/main/Main.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
//The code will blink an LED on GPIO8. To change the pin, modify Led(gpioPin: 8)
12+
// The code will blink an LED on GPIO8. To change the pin, modify Led(gpioPin: 8)
1313
@_cdecl("app_main")
14-
func app_main() {
15-
print("Hello from Swift on ESP32-C6!")
14+
func main() {
15+
print("Hello from Swift on ESP32-C6!")
1616

17-
var ledValue: Bool = false
18-
let blinkDelayMs: UInt32 = 500
19-
let led = Led(gpioPin: 8)
17+
var ledValue: Bool = false
18+
let blinkDelayMs: UInt32 = 500
19+
let led = Led(gpioPin: 8)
2020

21-
while true {
22-
led.setLed(value: ledValue)
23-
ledValue.toggle() // Toggle the boolean value
24-
vTaskDelay(blinkDelayMs / (1000 / UInt32(configTICK_RATE_HZ)))
25-
}
21+
while true {
22+
led.setLed(value: ledValue)
23+
ledValue.toggle() // Toggle the boolean value
24+
vTaskDelay(blinkDelayMs / (1000 / UInt32(configTICK_RATE_HZ)))
25+
}
2626
}

0 commit comments

Comments
 (0)