Skip to content

Commit 6ce46da

Browse files
authored
Merge pull request #3277 from hathach/remove-claude-code
remove claude code workflow
2 parents c1bf19e + f3f6046 commit 6ce46da

File tree

8 files changed

+83
-78
lines changed

8 files changed

+83
-78
lines changed

.github/copilot-instructions.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@ Choose ONE of these approaches:
1818
```bash
1919
cd examples/device/cdc_msc
2020
mkdir -p build && cd build
21-
cmake -DBOARD=stm32f407disco -DCMAKE_BUILD_TYPE=MinSizeRel ..
21+
cmake -DBOARD=raspberry_pi_pico -DCMAKE_BUILD_TYPE=MinSizeRel ..
2222
cmake --build . -j4
2323
```
2424
-- takes 1-2 seconds. NEVER CANCEL. Set timeout to 5+ minutes.
2525

26+
**CMake with Ninja (Alternative)**
27+
```bash
28+
cd examples/device/cdc_msc
29+
mkdir build && cd build
30+
cmake -G Ninja -DBOARD=raspberry_pi_pico ..
31+
ninja
32+
```
33+
2634
**Option 2: Individual Example with Make**
2735
```bash
2836
cd examples/device/cdc_msc
29-
make BOARD=stm32f407disco all
37+
make BOARD=raspberry_pi_pico all
3038
```
3139
-- takes 2-3 seconds. NEVER CANCEL. Set timeout to 5+ minutes.
3240

@@ -36,9 +44,39 @@ python3 tools/build.py -b BOARD_NAME
3644
```
3745
-- takes 15-20 seconds, may have some objcopy failures that are non-critical. NEVER CANCEL. Set timeout to 30+ minutes.
3846

47+
### Build Options
48+
- **Debug build**:
49+
- CMake: `-DCMAKE_BUILD_TYPE=Debug`
50+
- Make: `DEBUG=1`
51+
- **With logging**:
52+
- CMake: `-DLOG=2`
53+
- Make: `LOG=2`
54+
- **With RTT logger**:
55+
- CMake: `-DLOG=2 -DLOGGER=rtt`
56+
- Make: `LOG=2 LOGGER=rtt`
57+
- **RootHub port selection**:
58+
- CMake: `-DRHPORT_DEVICE=1`
59+
- Make: `RHPORT_DEVICE=1`
60+
- **Port speed**:
61+
- CMake: `-DRHPORT_DEVICE_SPEED=OPT_MODE_FULL_SPEED`
62+
- Make: `RHPORT_DEVICE_SPEED=OPT_MODE_FULL_SPEED`
63+
64+
### Flashing and Deploymen
65+
- **Flash with JLink**:1
66+
- CMake: `ninja cdc_msc-jlink`
67+
- Make: `make BOARD=raspberry_pi_pico flash-jlink`
68+
- **Flash with OpenOCD**:
69+
- CMake: `ninja cdc_msc-openocd`
70+
- Make: `make BOARD=raspberry_pi_pico flash-openocd`
71+
- **Generate UF2**:
72+
- CMake: `ninja cdc_msc-uf2`
73+
- Make: `make BOARD=raspberry_pi_pico all uf2`
74+
- **List all targets** (CMake/Ninja): `ninja -t targets`
75+
3976
### Unit Testing
4077
- Install Ceedling: `sudo gem install ceedling`
41-
- Run all unit tests: `cd test/unit-test && ceedling` -- takes 4 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
78+
- Run all unit tests: `cd test/unit-test && ceedling` or `cd test/unit-test && ceedling test:all` -- takes 4 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
79+
- Run specific test: `cd test/unit-test && ceedling test:test_fifo`
4280
- Tests use Unity framework with CMock for mocking
4381

4482
### Documentation
@@ -60,7 +98,7 @@ python3 tools/build.py -b BOARD_NAME
6098
2. **Build validation**: Build at least one example that exercises your changes
6199
```bash
62100
cd examples/device/cdc_msc
63-
make BOARD=stm32f407disco all
101+
make BOARD=raspberry_pi_pico all
64102
```
65103

66104
### Manual Testing Scenarios
@@ -70,7 +108,7 @@ python3 tools/build.py -b BOARD_NAME
70108

71109
### Board Selection for Testing
72110
- **STM32F4**: `stm32f407disco` - no external SDK required, good for testing
73-
- **RP2040**: `pico_sdk` - requires Pico SDK, commonly used
111+
- **RP2040**: `raspberry_pi_pico` - requires Pico SDK, commonly used
74112
- **Other families**: Check `hw/bsp/FAMILY/boards/` for available boards
75113

76114
## Common Tasks and Time Expectations
@@ -130,4 +168,23 @@ python3 tools/build.py -b BOARD_NAME
130168
- **Microchip**: SAM D/E/G/L families
131169
- Check `hw/bsp/` for complete list and `docs/reference/boards.rst` for details
132170

171+
## Code Style Guidelines
172+
173+
### General Coding Standards
174+
- Use C99 standard
175+
- Memory-safe: no dynamic allocation
176+
- Thread-safe: defer all interrupt events to non-ISR task functions
177+
- 2-space indentation, no tabs
178+
- Use snake_case for variables/functions
179+
- Use UPPER_CASE for macros and constants
180+
- Follow existing variable naming patterns in files you're modifying
181+
- Include proper header comments with MIT license
182+
- Add descriptive comments for non-obvious functions
183+
184+
### Best Practices
185+
- When including headers, group in order: C stdlib, tusb common, drivers, classes
186+
- Always check return values from functions that can fail
187+
- Use TU_ASSERT() for error checking with return statements
188+
- Follow the existing code patterns in the files you're modifying
189+
133190
Remember: TinyUSB is designed for embedded systems - builds are fast, tests are focused, and the codebase is optimized for resource-constrained environments.

.github/workflows/build.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ jobs:
198198
needs: hil-build
199199
runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
200200
steps:
201+
- name: Get Skip Boards from previous run
202+
if: github.run_attempt != '1'
203+
run: |
204+
if [ -f "${{ env.HIL_JSON }}.skip" ]; then
205+
SKIP_BOARDS=$(cat "${{ env.HIL_JSON }}.skip")
206+
else
207+
SKIP_BOARDS=""
208+
fi
209+
echo "SKIP_BOARDS=$SKIP_BOARDS"
210+
echo "SKIP_BOARDS=$SKIP_BOARDS" >> $GITHUB_ENV
211+
201212
- name: Clean workspace
202213
run: |
203214
echo "Cleaning up for the first run"
@@ -213,25 +224,8 @@ jobs:
213224
path: cmake-build
214225
merge-multiple: true
215226

216-
- name: Cache skip list
217-
uses: actions/cache@v4
218-
with:
219-
path: ${{ env.HIL_JSON }}.skip
220-
key: hil-skip-${{ github.run_id }}-${{ github.run_attempt }}
221-
restore-keys: |
222-
hil-skip-${{ github.run_id }}-
223-
224227
- name: Test on actual hardware
225228
run: |
226-
ls cmake-build/
227-
228-
# Skip boards that passed with previous run, file is generated by hil_test.py
229-
SKIP_BOARDS=""
230-
if [ -f ${{ env.HIL_JSON }}.skip ]; then
231-
SKIP_BOARDS=$(cat "${HIL_JSON}.skip")
232-
fi
233-
echo "SKIP_BOARDS=$SKIP_BOARDS"
234-
235229
python3 test/hil/hil_test.py ${{ env.HIL_JSON }} $SKIP_BOARDS
236230
237231
# ---------------------------------------

.github/workflows/claude.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

examples/device/mtp/src/mtp_fs_example.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ static fs_file_t fs_objects[FS_MAX_FILE_COUNT] = {
111111
.image_bit_depth = 0,
112112
.parent = 0,
113113
.association_type = MTP_ASSOCIATION_UNDEFINED,
114+
.size = sizeof(README_TXT_CONTENT)-1,
114115
.data = (uint8_t*) (uintptr_t) README_TXT_CONTENT,
115-
.size = sizeof(README_TXT_CONTENT)-1
116116
},
117117
{
118118
.name = { 't', 'i', 'n', 'y', 'u', 's', 'b', '.', 'p', 'n', 'g', 0 }, // "tinyusb.png"
@@ -123,8 +123,8 @@ static fs_file_t fs_objects[FS_MAX_FILE_COUNT] = {
123123
.image_bit_depth = 32,
124124
.parent = 0,
125125
.association_type = MTP_ASSOCIATION_UNDEFINED,
126-
.data = (uint8_t*) (uintptr_t) logo_bin,
127-
.size = logo_len,
126+
.size = LOGO_LEN,
127+
.data = (uint8_t*) (uintptr_t) logo_bin
128128
}
129129
};
130130

@@ -391,7 +391,7 @@ static int32_t fs_get_storage_info(tud_mtp_cb_data_t* cb_data) {
391391
const uint32_t storage_id = command->params[0];
392392
TU_VERIFY(SUPPORTED_STORAGE_ID == storage_id, -1);
393393
// update storage info with current free space
394-
storage_info.max_capacity_in_bytes = sizeof(README_TXT_CONTENT) + logo_len + FS_MAX_CAPACITY_BYTES;
394+
storage_info.max_capacity_in_bytes = sizeof(README_TXT_CONTENT) + LOGO_LEN + FS_MAX_CAPACITY_BYTES;
395395
storage_info.free_space_in_objects = FS_MAX_FILE_COUNT - fs_get_file_count();
396396
storage_info.free_space_in_bytes = storage_info.free_space_in_objects ? FS_MAX_CAPACITY_BYTES : 0;
397397
mtp_container_add_raw(io_container, &storage_info, sizeof(storage_info));

examples/device/mtp/src/tinyusb_logo_png.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// convert using tools/file2carray.py
2-
const size_t logo_len = 2733;
3-
const uint8_t logo_bin[] __attribute__((aligned(16))) = {
2+
enum { LOGO_LEN = 2733 };
3+
static const uint8_t logo_bin[] __attribute__((aligned(16))) = {
44
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
55
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x08, 0x06, 0x00, 0x00, 0x00, 0xd2, 0xd6, 0x7f,
66
0x7f, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,

hw/bsp/samd11/family.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CFLAGS += \
88
-DOSC32K_OVERWRITE_CALIBRATION=0 \
99
-DCFG_EXAMPLE_MSC_READONLY \
1010
-DCFG_EXAMPLE_VIDEO_READONLY \
11+
-DCFG_EXAMPLE_MTP_READONLY \
1112
-DCFG_TUSB_MCU=OPT_MCU_SAMD11
1213

1314
# suppress warning caused by vendor mcu driver

hw/bsp/stm32u0/family.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SRC_C += \
3333
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
3434
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
3535
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
36+
${ST_HAL_DRIVER}/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c \
3637
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c
3738

3839
INC += \

tools/file2carray.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def main():
3535
fout_name = fin_name + '.h'
3636
with open(fout_name, 'w') as fout:
3737
print(f"Converting {fin_name} to {fout_name}")
38-
fout.write(f'const size_t bindata_len = {len(contents)};\n')
38+
fout.write(f'enum {{ BINDATA_LEN = {len(contents)} }};\n')
39+
fout.write(f'const size_t bindata_len = BINDATA_LEN;\n')
3940
fout.write(f'const uint8_t bindata[] __attribute__((aligned(16))) = {{')
4041
print_carray(fout, contents)
4142
fout.write('};\n')

0 commit comments

Comments
 (0)