Skip to content

Commit f5b3485

Browse files
Initial simple working project
0 parents  commit f5b3485

16 files changed

+666
-0
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: MrGreensWorkshop
2+
patreon: MrGreensWorkshop
3+
ko_fi: MrGreensWorkshop
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ask a Question
2+
description: Something is not going according to plan?
3+
title: "<title>"
4+
labels: "delete me"
5+
body:
6+
- type: checkboxes
7+
attributes:
8+
label: Please check these items before go any further
9+
description: Please search to see if an issue or discussion already exists for the problem you encountered.
10+
options:
11+
- label: I have watched [the related video](https://youtu.be/C4Kq1r9A0k0) on YouTube.
12+
required: true
13+
- label: I have searched the existing [Issues](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/issues/).
14+
required: true
15+
- label: I have searched the existing [Discussions](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/discussions/).
16+
required: true
17+
- type: markdown
18+
attributes:
19+
value: |
20+
Checked all above but still couldn't find an answer?
21+
#### [Click here to ask a question in Discussions](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/discussions/new?category=problems)
22+
- type: dropdown
23+
id: t
24+
attributes:
25+
label: "."
26+
options:
27+
- .
28+
validations:
29+
required: true
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Bug report
2+
description: Create a bug report to help us improve
3+
title: "<title>"
4+
labels: bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## Thank you for contributing to this project!"
9+
- type: checkboxes
10+
attributes:
11+
label: Please check these items before go any further
12+
description: Please search to see if an issue already exists for the bug you encountered.
13+
options:
14+
- label: I have watched [the related video](https://youtu.be/C4Kq1r9A0k0) on YouTube.
15+
required: true
16+
- label: I have searched the existing [Issues](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/issues/).
17+
required: true
18+
- label: I have searched the existing [Discussions](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/discussions/).
19+
required: true
20+
- type: checkboxes
21+
attributes:
22+
label: Are you sure this is a bug?
23+
description: |
24+
The Issues in this repo is only used for 'Bug reports' or 'Feature requests'.
25+
If you are not sure if this is a bug or not, please ask a question from [Discussions](https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/issues/new?assignees=&labels=delete+me&template=a_questions.yml&title=%3Ctitle%3E).
26+
options:
27+
- label: I'm sure this is definitely a bug.
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: Describe the bug
32+
description: |
33+
A clear and concise description of what the bug is.
34+
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Expected Behavior
40+
description: A clear and concise description of what you expected to happen.
41+
validations:
42+
required: true
43+
- type: textarea
44+
attributes:
45+
label: Steps To Reproduce
46+
description: Steps to reproduce the behavior.
47+
#value: |
48+
placeholder: |
49+
1. Go to '...'
50+
2. Push the button when '...'
51+
3. See the error
52+
validations:
53+
required: true
54+
- type: checkboxes
55+
attributes:
56+
label: Which device have you used?
57+
description: You may select more than one.
58+
options:
59+
- label: Raspberry Pi Pico
60+
required: false
61+
- label: Raspberry Pi Pico W (This project hasn't been tested on Raspberry Pi Pico W)
62+
required: false
63+
- type: textarea
64+
attributes:
65+
label: Anything else?
66+
description: |
67+
Links? References? Anything that will give us more context about the issue you are encountering!
68+
validations:
69+
required: false
70+
- type: markdown
71+
attributes:
72+
value: |
73+
Thank you for taking the time to fill out this bug report.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Enhancement or Feature
2+
description: Use this with related PR that you created
3+
title: "<title>"
4+
labels: enhancement
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "### Thank you for contributing to this project!"
9+
- type: textarea
10+
attributes:
11+
label: Is this enhancement or feature is related to a problem?
12+
description: |
13+
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
14+
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Describe the solution you'd like
20+
placeholder: A clear and concise description of what you want to happen.
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Describe alternatives you've considered
26+
placeholder: A clear and concise description of any alternative solutions or features you've considered.
27+
validations:
28+
required: false
29+
- type: textarea
30+
attributes:
31+
label: Additional context
32+
placeholder: Add any other context or screenshots about the feature request here.
33+
validations:
34+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature request
4+
url: https://github.com/MrGreensWorkshop/RasPiPicoSDK-PicoBiosPostCodeReader/discussions/new?category=feature-requests
5+
about: Please submit your Feature request here.

.github/pull_request_template.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#### About pull request
2+
- To get more insight, please check the related issue #XXX.
3+
4+
#### What's changed to accomplish [problem / feature] described in issue
5+
<!-- Please provide a description of the changes proposed in the pull request -->
6+
7+
Coding rule check is done [yes / no]
8+
9+
<!--
10+
For beginners
11+
12+
- Please create an issue before creating a pull request. (You will find issue templates which guides you.)
13+
- Create a reference to your issue using #<issue number>.
14+
- A description of the changes proposed in the pull request.
15+
- Check questions and change it [a / b] to [a] or [b]
16+
-->
17+
18+
<!--
19+
#### Coding rule check
20+
21+
Please make sure the following rules are followed
22+
23+
1. spaces and line breaks
24+
- rule : some code tools change all code syntax. Please make sure no spaces or line breaks have been added or removed unless it is related with the Pull Request
25+
- why : reviewing diff of codes gets a lot easier, because reviewers can pay attention to a code review.
26+
- rule : if .editorconfig file exist in this repo, please use editor that supports .editorconfig (https://editorconfig.org). This takes care of charset, line endings and indents.
27+
- why : reviewing diff of codes gets a lot easier, because reviewers can pay attention to a code review.
28+
2. comments (for all programming languages)
29+
- rule : comments will be written on the top of the code lines, not the end of code line
30+
- why : reviewing diff of codes gets a lot easier, because reviewers can pay attention to a code review.
31+
-->

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Intentionally untracked files that Git should ignore
2+
3+
# VS Code
4+
.vscode/*
5+
!.vscode/launch.json
6+
!.vscode/settings.json
7+
8+
# Build folder
9+
/build*
10+
11+
# Windows
12+
Thumbs.db
13+
14+
# macOS
15+
.DS_Store
16+
17+
# Backup files
18+
*.bak

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
{
7+
"version": "0.2.0",
8+
"configurations": [{
9+
"name": "Pico SDK Debug",
10+
"device": "RP2040",
11+
"gdbPath": "arm-none-eabi-gdb",
12+
"cwd": "${workspaceRoot}",
13+
"executable": "build/PicoBiosPostCodeReader.elf",
14+
"request": "launch",
15+
"type": "cortex-debug",
16+
"servertype": "openocd",
17+
"configFiles": [
18+
"/interface/picoprobe.cfg",
19+
"/target/rp2040.cfg"
20+
],
21+
"searchDir": ["${env:HOME}/openocd/tcl"],
22+
"svdFile": "${env:HOME}/pico-sdk/src/rp2040/hardware_regs/rp2040.svd",
23+
"runToEntryPoint": "main",
24+
"postRestartCommands": [
25+
"break main",
26+
"continue"
27+
]
28+
}]
29+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
{
7+
"terminal.integrated.env.osx": {
8+
"PICO_SDK_PATH": "${env:HOME}/pico-sdk"
9+
},
10+
"terminal.integrated.env.linux": {
11+
"PICO_SDK_PATH": "${env:HOME}/pico-sdk"
12+
},
13+
"terminal.integrated.env.windows": {
14+
"PICO_SDK_PATH": "${env:USERPROFILE}\\pico-sdk",
15+
}
16+
}

CMakeLists.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Set minimum CMake version
5+
cmake_minimum_required(VERSION 3.17)
6+
7+
# Include the subsidiary .cmake file to get the SDK
8+
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
9+
10+
# Set the name and version of the project
11+
project(PicoBiosPostCodeReader VERSION 1.0.0)
12+
13+
# Set top source code folder
14+
set(SOURCE_FOLDER "src")
15+
16+
# Set build type (options: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo')
17+
set(default_build_type "Release")
18+
19+
# Set CMAKE_BUILD_TYPE
20+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build, options are: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'." FORCE)
21+
22+
# Initialize the SDK
23+
pico_sdk_init()
24+
25+
# Add an executable target for the project
26+
add_executable(${PROJECT_NAME})
27+
28+
# Get all the pio files, when the glob value changes, cmake will run again and update the files
29+
file(GLOB_RECURSE pio_src CONFIGURE_DEPENDS "${SOURCE_FOLDER}/*.pio")
30+
31+
# Convert List to String
32+
STRING(REPLACE ";" "\n" PIO_SRC_STR "${pio_src}")
33+
34+
# Print the pio source file list
35+
message(STATUS "PIO code source files: \n${PIO_SRC_STR}")
36+
37+
# If there are any PIO source files, include them to the build.
38+
if (NOT pio_src STREQUAL "")
39+
pico_generate_pio_header(${PROJECT_NAME} ${pio_src})
40+
endif()
41+
42+
# Get all C and C++ files, when the glob value changes, cmake will run again and update the files
43+
file(GLOB_RECURSE app_src CONFIGURE_DEPENDS "${SOURCE_FOLDER}/*.c" "${SOURCE_FOLDER}/*.cpp" )
44+
45+
# Convert List to String
46+
STRING(REPLACE ";" "\n" APP_SRC_STR "${app_src}")
47+
48+
# Print the C and C++ source file list
49+
message(STATUS "C and C++ source files: \n${APP_SRC_STR}")
50+
51+
# Add C and C++ source files to the build
52+
target_sources(${PROJECT_NAME} PRIVATE ${app_src})
53+
54+
# Link the Project to extra libraries
55+
target_link_libraries(${PROJECT_NAME} PRIVATE
56+
pico_stdlib
57+
hardware_pio
58+
)
59+
60+
# Including header files directly from project directory
61+
target_include_directories(${PROJECT_NAME} PRIVATE
62+
${CMAKE_CURRENT_LIST_DIR}
63+
)
64+
65+
# Export binaries like hex, bin, and uf2 files.
66+
pico_add_extra_outputs(${PROJECT_NAME})
67+
68+
# Enable or Disable UART
69+
pico_enable_stdio_uart(${PROJECT_NAME} 0)
70+
71+
# Enable or Disable USB CDC
72+
pico_enable_stdio_usb(${PROJECT_NAME} 1)
73+
74+
# Disable DTR check for USB CDC connection
75+
add_definitions(-DPICO_STDIO_USB_CONNECTION_WITHOUT_DTR=1)
76+
77+
# Set USB device as self powered device
78+
#add_definitions(-DPICO_STDIO_USB_DEVICE_SELF_POWERED=1)

0 commit comments

Comments
 (0)