* Add ...3.27 to the cmake_minimum_required, and make minimum 3.13 everywhere
Signed-off-by: Ghorban M. Tavakoly <gmt3141@gmail.com>
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
Running a build with a newer CMake version results in a deprecation
warning from the tools subdirectory
[13/108] Performing configure step for 'PioasmBuild'
loading initial cache file /.../build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp/PioasmBuild-cache-Release.cmake
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
Raise the minimum version requirement for the tools to the same version
that is required in the top-level CMakeLists.txt anyway.
* Fix various non-GCC warnings (no effect on GCC)
* Reduce use of typeof since non GCC compilers may not support it
* Introduce PICO_C_COMPILER_IS_GNU, PICO_C_COMPILER_IS_CLANG, PICO_C_COMPILER_IS_IAR to CMake as if (CMAKE_C_COMPILER_ID STREQUAL "xxx") is a bit verbose
* Use "unified_asm" macro for all inline asm (it is "volatile __asm" on GNU with a .syntex unified)
* Use NOLOAD instead of COPY in linker scripts (arguably more correct anyway)
* Use the same style for setting _etext in all 4 linker scripts (to the beginning of .data). Clang aligns .data on a 16 byte boundary. Note ideally we'd
add a new symbol __data_source, however that would break backwards compatibility with existing user linker scripts
* Use "a" for .stack, .heap sections because clang complains otherwise, and they are explicitly NOLOAD anyway
* Avoid duplicating __sev, __wfe, __wfi which Clang sometimes seems to provide as built-ins
* Add missing kitchen_sink_blocked_ram binary
* Allow build with LLVM Embedded Toolchain Form ARM v 14.0.0 (unsupported atm)
* Added ARCHIVE_OUTPUT_DIRECTORY to uf2 output in CMake
This Commit enables the use of the ARCHIVE_OUTPUT_DIRECTORY target
properties in CMake for the generation of uf2 files.
The changeset in lines 47..51 is necessary due to CMake not
automatically creating the ARCHIVE_OUTPUT_DIRECTORY if no archive target
is present.
* rework cmake changes to make it friendler for non absolute paths
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
While working on the [online pioasm](https://wokwi.com/tools/pioasm), I found several PIO instructions that result in invalid python code. Here is a small program that demonstrate the issue:
```
.program python_issue
push block
wait 0 irq 1 rel
irq clear 1 rel
```
And the resulting Python program:
```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #
import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #
@rp2.asm_pio()
def python_test():
wrap_target()
push(, block) # 0
wait(0, irq, 1 rel) # 1
irq(clear 1 rel) # 2
wrap()
```
After this fix, the above program compiles to a valid python syntax:
```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #
import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #
@rp2.asm_pio()
def python_test():
wrap_target()
push(block) # 0
wait(0, irq, rel(1)) # 1
irq(clear, rel(1)) # 2
wrap()
```