Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for controlling a chain of WS2812 LEDs using ESP32 RMT periph… #1849

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

vbenso
Copy link
Contributor

@vbenso vbenso commented Jul 26, 2023

Summary

Recently a driver to transmit pulse trains using ESP32 RMT peripheral was merged to nuttX in PR apache/nuttx#6992

To demonstrate the usage of the mentioned driver, an application that drives a chain of WS2812 LEDS was written.

Impact

Testing

This application was tested in an ESP32 devkitc board driving up to 768 WS2812 RGB LEDs.

@acassis
Copy link
Contributor

acassis commented Jul 26, 2023

@vbenso please fix the coding style issues:

Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:2:1: error: Relative file path does not match actual file
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:51:3: error: Invalid section for this file type
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:56:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:64:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:64:1: error: Too many blank lines
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:67:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:70:14: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:74:18: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:76:1: error: Too many blank lines
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:77:1: error: Too many blank lines
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:82:55: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:86:2: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:86:18: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:86:18: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:86:20: error: Missing whitespace after semicolon
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:89:10: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:89:12: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:91:6: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:93:21: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:93:22: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:93:36: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:93:36: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:97:21: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:97:22: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:97:36: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:97:36: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:98:7: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:107:40: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:185:2: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:186:2: error: Bad left brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:187:85: error: Long line found
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:188:4: error: Bad alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:189:2: error: Bad right brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:193:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:194:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:195:2: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:196:2: error: Bad left brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:198:4: error: Bad alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:200:6: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:200:22: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:200:22: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:201:6: error: Bad left brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:202:8: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:202:8: error: Bad alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:205:30: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:209:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:210:8: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:210:8: error: Bad alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:213:30: error: Upper case hex constant found
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:215:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:216:1: error: Blank line precedes right brace at line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:217:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:218:1: error: Blank line precedes right brace at line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:218:6: error: Bad right brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:218:7: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:219:6: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:219:14: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:219:15: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:222:88: error: Long line found
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:223:6: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:224:6: error: Bad left brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:226:8: error: Bad alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:227:6: error: Bad right brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:229:56: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:230:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:231:6: error: Missing whitespace after keyword
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:231:12: error: Operator/assignment must be preceded with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:231:12: error: Operator/assignment must be followed with whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:236:1: error: Blank line contains whitespace
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:237:80: error: Long line found
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:238:1: error: Blank line contains whitespace/
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:239:21: error: Dangling whitespace at the end of line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:240:5: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:242:2: error: Bad right brace alignment
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c:245:18: error: Missing whitespace after semicolon

you can run from apps/ calling the checkpatch.sh inside nuttx/tools/

../nuttx/tools/checkpatch.sh -f examples/ws2812esp32rmt/ws2812esp32rmt_main.c

@vbenso
Copy link
Contributor Author

vbenso commented Jul 26, 2023

Ok, I'll be away from my PC up to Tuesday... But I'll fix the coding style. Perhaps until then, if other fixes come up, let me know.

@vbenso
Copy link
Contributor Author

vbenso commented Jul 29, 2023

@acassis
Style fixed.
I'm still in search for a way to check for the styling rules while editing the code using vscode.
Imagine Crtl+Shift+I and boom, code fixed. That would be awesome.

@acassis acassis merged commit 52ec336 into apache:master Jul 30, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants