Skip to content

Commit 98231df

Browse files
Update tests to the latest version.
1 parent acf0a5b commit 98231df

42 files changed

Lines changed: 452 additions & 200 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tools/pioasm/test/valid/basic/test_all_directives_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
// #include "hardware/pio.h"
3434
// #endif
3535
//
36+
// #ifdef __cpp_constexpr
37+
// #define __pio_const constexpr
38+
// #else
39+
// #define __pio_const const
40+
// #endif
41+
//
3642
// // --------------- //
3743
// // directives_test //
3844
// // --------------- //
@@ -43,7 +49,7 @@
4349
//
4450
// #define directives_test_myconst 42
4551
//
46-
// static const uint16_t directives_test_program_instructions[] = {
52+
// static __pio_const uint16_t directives_test_program_instructions[] = {
4753
// // .wrap_target
4854
// 0xb442, // 0: nop side 1
4955
// 0x80a0, // 1: pull block
@@ -55,7 +61,7 @@
5561
// };
5662
//
5763
// #if !PICO_NO_HARDWARE
58-
// static const struct pio_program directives_test_program = {
64+
// static __pio_const struct pio_program directives_test_program = {
5965
// .instructions = directives_test_program_instructions,
6066
// .length = 6,
6167
// .origin = 3,

tools/pioasm/test/valid/basic/test_minimal_program_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
// #include "hardware/pio.h"
1717
// #endif
1818
//
19+
// #ifdef __cpp_constexpr
20+
// #define __pio_const constexpr
21+
// #else
22+
// #define __pio_const const
23+
// #endif
24+
//
1925
// // ------- //
2026
// // minimal //
2127
// // ------- //
@@ -24,14 +30,14 @@
2430
// #define minimal_wrap 0
2531
// #define minimal_pio_version 0
2632
//
27-
// static const uint16_t minimal_program_instructions[] = {
33+
// static __pio_const uint16_t minimal_program_instructions[] = {
2834
// // .wrap_target
2935
// 0xa042, // 0: nop
3036
// // .wrap
3137
// };
3238
//
3339
// #if !PICO_NO_HARDWARE
34-
// static const struct pio_program minimal_program = {
40+
// static __pio_const struct pio_program minimal_program = {
3541
// .instructions = minimal_program_instructions,
3642
// .length = 1,
3743
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_all_config_directives_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
// #include "hardware/pio.h"
3535
// #endif
3636
//
37+
// #ifdef __cpp_constexpr
38+
// #define __pio_const constexpr
39+
// #else
40+
// #define __pio_const const
41+
// #endif
42+
//
3743
// // ----------------------- //
3844
// // everything_kitchen_sink //
3945
// // ----------------------- //
@@ -44,7 +50,7 @@
4450
//
4551
// #define everything_kitchen_sink_test_constant 42
4652
//
47-
// static const uint16_t everything_kitchen_sink_program_instructions[] = {
53+
// static __pio_const uint16_t everything_kitchen_sink_program_instructions[] = {
4854
// // .wrap_target
4955
// 0xfb03, // 0: set pins, 3 side 2 [3]
5056
// 0x7608, // 1: out pins, 8 side 1 [2]
@@ -56,7 +62,7 @@
5662
// };
5763
//
5864
// #if !PICO_NO_HARDWARE
59-
// static const struct pio_program everything_kitchen_sink_program = {
65+
// static __pio_const struct pio_program everything_kitchen_sink_program = {
6066
// .instructions = everything_kitchen_sink_program_instructions,
6167
// .length = 6,
6268
// .origin = 10,

tools/pioasm/test/valid/comprehensive/test_in_all_sources_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
// #include "hardware/pio.h"
2323
// #endif
2424
//
25+
// #ifdef __cpp_constexpr
26+
// #define __pio_const constexpr
27+
// #else
28+
// #define __pio_const const
29+
// #endif
30+
//
2531
// // ---------- //
2632
// // in_sources //
2733
// // ---------- //
@@ -30,7 +36,7 @@
3036
// #define in_sources_wrap 6
3137
// #define in_sources_pio_version 0
3238
//
33-
// static const uint16_t in_sources_program_instructions[] = {
39+
// static __pio_const uint16_t in_sources_program_instructions[] = {
3440
// // .wrap_target
3541
// 0x4004, // 0: in pins, 4
3642
// 0x4028, // 1: in x, 8
@@ -43,7 +49,7 @@
4349
// };
4450
//
4551
// #if !PICO_NO_HARDWARE
46-
// static const struct pio_program in_sources_program = {
52+
// static __pio_const struct pio_program in_sources_program = {
4753
// .instructions = in_sources_program_instructions,
4854
// .length = 7,
4955
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_irq_all_variants_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
// #include "hardware/pio.h"
2424
// #endif
2525
//
26+
// #ifdef __cpp_constexpr
27+
// #define __pio_const constexpr
28+
// #else
29+
// #define __pio_const const
30+
// #endif
31+
//
2632
// // -------- //
2733
// // irq_test //
2834
// // -------- //
@@ -31,7 +37,7 @@
3137
// #define irq_test_wrap 7
3238
// #define irq_test_pio_version 1
3339
//
34-
// static const uint16_t irq_test_program_instructions[] = {
40+
// static __pio_const uint16_t irq_test_program_instructions[] = {
3541
// // .wrap_target
3642
// 0xc000, // 0: irq nowait 0
3743
// 0xc007, // 1: irq nowait 7
@@ -45,7 +51,7 @@
4551
// };
4652
//
4753
// #if !PICO_NO_HARDWARE
48-
// static const struct pio_program irq_test_program = {
54+
// static __pio_const struct pio_program irq_test_program = {
4955
// .instructions = irq_test_program_instructions,
5056
// .length = 8,
5157
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_jmp_all_conditions_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ start:
2424
// #include "hardware/pio.h"
2525
// #endif
2626
//
27+
// #ifdef __cpp_constexpr
28+
// #define __pio_const constexpr
29+
// #else
30+
// #define __pio_const const
31+
// #endif
32+
//
2733
// // -------- //
2834
// // jmp_test //
2935
// // -------- //
@@ -32,7 +38,7 @@ start:
3238
// #define jmp_test_wrap 7
3339
// #define jmp_test_pio_version 0
3440
//
35-
// static const uint16_t jmp_test_program_instructions[] = {
41+
// static __pio_const uint16_t jmp_test_program_instructions[] = {
3642
// // .wrap_target
3743
// 0x0000, // 0: jmp 0
3844
// 0x0020, // 1: jmp !x, 0
@@ -46,7 +52,7 @@ start:
4652
// };
4753
//
4854
// #if !PICO_NO_HARDWARE
49-
// static const struct pio_program jmp_test_program = {
55+
// static __pio_const struct pio_program jmp_test_program = {
5056
// .instructions = jmp_test_program_instructions,
5157
// .length = 8,
5258
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_mov_all_combinations_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
// #include "hardware/pio.h"
2828
// #endif
2929
//
30+
// #ifdef __cpp_constexpr
31+
// #define __pio_const constexpr
32+
// #else
33+
// #define __pio_const const
34+
// #endif
35+
//
3036
// // --------- //
3137
// // mov_combo //
3238
// // --------- //
@@ -35,7 +41,7 @@
3541
// #define mov_combo_wrap 10
3642
// #define mov_combo_pio_version 1
3743
//
38-
// static const uint16_t mov_combo_program_instructions[] = {
44+
// static __pio_const uint16_t mov_combo_program_instructions[] = {
3945
// // .wrap_target
4046
// 0xa022, // 0: mov x, y
4147
// 0xa041, // 1: mov y, x
@@ -52,7 +58,7 @@
5258
// };
5359
//
5460
// #if !PICO_NO_HARDWARE
55-
// static const struct pio_program mov_combo_program = {
61+
// static __pio_const struct pio_program mov_combo_program = {
5662
// .instructions = mov_combo_program_instructions,
5763
// .length = 11,
5864
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_mov_all_operations_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
// #include "hardware/pio.h"
2525
// #endif
2626
//
27+
// #ifdef __cpp_constexpr
28+
// #define __pio_const constexpr
29+
// #else
30+
// #define __pio_const const
31+
// #endif
32+
//
2733
// // -------- //
2834
// // mov_test //
2935
// // -------- //
@@ -32,7 +38,7 @@
3238
// #define mov_test_wrap 8
3339
// #define mov_test_pio_version 1
3440
//
35-
// static const uint16_t mov_test_program_instructions[] = {
41+
// static __pio_const uint16_t mov_test_program_instructions[] = {
3642
// // .wrap_target
3743
// 0xa022, // 0: mov x, y
3844
// 0xa02a, // 1: mov x, ~y
@@ -47,7 +53,7 @@
4753
// };
4854
//
4955
// #if !PICO_NO_HARDWARE
50-
// static const struct pio_program mov_test_program = {
56+
// static __pio_const struct pio_program mov_test_program = {
5157
// .instructions = mov_test_program_instructions,
5258
// .length = 9,
5359
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_out_all_destinations_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
// #include "hardware/pio.h"
2424
// #endif
2525
//
26+
// #ifdef __cpp_constexpr
27+
// #define __pio_const constexpr
28+
// #else
29+
// #define __pio_const const
30+
// #endif
31+
//
2632
// // ----------- //
2733
// // out_targets //
2834
// // ----------- //
@@ -31,7 +37,7 @@
3137
// #define out_targets_wrap 7
3238
// #define out_targets_pio_version 0
3339
//
34-
// static const uint16_t out_targets_program_instructions[] = {
40+
// static __pio_const uint16_t out_targets_program_instructions[] = {
3541
// // .wrap_target
3642
// 0x6004, // 0: out pins, 4
3743
// 0x6028, // 1: out x, 8
@@ -45,7 +51,7 @@
4551
// };
4652
//
4753
// #if !PICO_NO_HARDWARE
48-
// static const struct pio_program out_targets_program = {
54+
// static __pio_const struct pio_program out_targets_program = {
4955
// .instructions = out_targets_program_instructions,
5056
// .length = 8,
5157
// .origin = -1,

tools/pioasm/test/valid/comprehensive/test_push_pull_all_modes_valid.pio

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
// #include "hardware/pio.h"
2626
// #endif
2727
//
28+
// #ifdef __cpp_constexpr
29+
// #define __pio_const constexpr
30+
// #else
31+
// #define __pio_const const
32+
// #endif
33+
//
2834
// // -------------- //
2935
// // push_pull_test //
3036
// // -------------- //
@@ -33,7 +39,7 @@
3339
// #define push_pull_test_wrap 9
3440
// #define push_pull_test_pio_version 0
3541
//
36-
// static const uint16_t push_pull_test_program_instructions[] = {
42+
// static __pio_const uint16_t push_pull_test_program_instructions[] = {
3743
// // .wrap_target
3844
// 0x8020, // 0: push block
3945
// 0x8020, // 1: push block
@@ -49,7 +55,7 @@
4955
// };
5056
//
5157
// #if !PICO_NO_HARDWARE
52-
// static const struct pio_program push_pull_test_program = {
58+
// static __pio_const struct pio_program push_pull_test_program = {
5359
// .instructions = push_pull_test_program_instructions,
5460
// .length = 10,
5561
// .origin = -1,

0 commit comments

Comments
 (0)