Skip to content

Commit e4044d5

Browse files
Carl PetoCarl Peto
authored andcommitted
add avr test, attempt to fix regression, suggested small tweak to documentation
1 parent 1a2e298 commit e4044d5

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docs/EmbeddedSwift/UserManual.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ A typical setup and build + run cycle for an embedded development board involves
2222
- (1) Getting an SDK with the C compilers, headers and libraries for the target
2323
- (2) Building the C source code, and Swift source code into object files.
2424
- (3) Linking all the libraries, C object files, and Swift object files.
25-
- (4) Post-processing the linked firmware into a flashable format (UF2, BIN, or bespoke formats)
26-
- (5) Uploading the flashable binary to the board over a USB cable using some vendor-provided JTAG/SWD tool or by copying it to a fake USB Mass Storage volume presented by the board.
25+
- (4) Post-processing the linked firmware into a flashable format (UF2, BIN, HEX, or bespoke formats)
26+
- (5) Uploading the flashable binary to the board over a USB cable using some vendor-provided JTAG/SWD tool, by copying it to a fake USB Mass Storage volume presented by the board or a custom platform bootloader.
2727
- (6) Restarting the board, observing physical effects of the firmware (LEDs light up) or UART output over USB, or presence on network, etc.
2828

2929
Most of these steps are out of scope for this document, instead refer to the vendor provided documentation. This document only focuses on (2) from the list above, and it's important that you first get familiar with the details of firmware development for your board without Swift in the mix. Even if you want to build a completely pure Swift firmware, you are still going to need the vendor provided tooling for linking, post-processing, uploading, etc.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %swift -typecheck %s -verify -target avr-none-none -disable-objc-interop -parse-stdlib
2+
3+
#if arch(avr) && os(none) && _runtime(_Native) && _endian(little)
4+
class C {}
5+
var x = C()
6+
#endif
7+
var y = x
8+

test/Parse/ConditionalCompilation/basicParseErrors.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ undefinedFunc() // expected-error {{cannot find 'undefinedFunc' in scope}}
125125
/// Invalid platform condition arguments don't invalidate the whole condition.
126126
#if !arch(arn) && !os(ystem) && !_endian(ness)
127127
// expected-warning@-1 {{unknown architecture for build configuration 'arch'}}
128-
// expected-note@-2 {{did you mean 'arm'?}} {{11-18=arm}}
128+
// expected-note@-2 {{did you mean 'arm'?}} {{11-14=arm}}
129129
// expected-warning@-3 {{unknown operating system for build configuration 'os'}}
130-
// expected-note@-4 {{did you mean 'OSX'?}} {{27-32=OSX}}
131-
// expected-note@-5 {{did you mean 'PS4'?}} {{27-32=PS4}}
132-
// expected-note@-6 {{did you mean 'none'?}} {{27-32=none}}
130+
// expected-note@-4 {{did you mean 'OSX'?}} {{23-28=OSX}}
131+
// expected-note@-5 {{did you mean 'PS4'?}} {{23-28=PS4}}
132+
// expected-note@-6 {{did you mean 'none'?}} {{23-28=none}}
133133
// expected-warning@-7 {{unknown endianness for build configuration '_endian'}}
134-
// expected-note@-8 {{did you mean 'big'?}} {{46-50=big}}
134+
// expected-note@-8 {{did you mean 'big'?}} {{42-46=big}}
135135
func fn_k() {}
136136
#endif
137137
fn_k()
138138

139-
#if os(cillator) || arch(arn)
139+
#if os(cillator) || arch(i3rm)
140140
// expected-warning@-1 {{unknown operating system for build configuration 'os'}}
141141
// expected-note@-2 {{did you mean 'macOS'?}} {{8-16=macOS}}
142142
// expected-note@-3 {{did you mean 'iOS'?}} {{8-16=iOS}}
143143
// expected-warning@-4 {{unknown architecture for build configuration 'arch'}}
144-
// expected-note@-5 {{did you mean 'arm'?}} {{26-29=arm}}
145-
// expected-note@-6 {{did you mean 'i386'?}} {{26-29=i386}}
144+
// expected-note@-5 {{did you mean 'arm'?}} {{26-30=arm}}
145+
// expected-note@-6 {{did you mean 'i386'?}} {{26-30=i386}}
146146
// expected-note@-7 {{did you mean 'visionOS'?}} {{8-16=visionOS}}
147147
func undefinedFunc() // ignored.
148148
#endif

0 commit comments

Comments
 (0)