File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ struct Led {
23
23
fatalError ( " cannot reset led " )
24
24
}
25
25
}
26
- func setLed( value: Bool ) {
26
+ func setLed( value: Bool ) {
27
27
let level : UInt32 = value ? 1 : 0
28
28
gpio_set_level ( ledPin, level)
29
29
}
Original file line number Diff line number Diff line change 9
9
//
10
10
//===----------------------------------------------------------------------===//
11
11
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)
13
13
@_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! " )
16
16
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 )
20
20
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
+ }
26
26
}
You can’t perform that action at this time.
0 commit comments