Skip to content

Commit

Permalink
Merge pull request #1 from ElectronicCats/no_infect
Browse files Browse the repository at this point in the history
publish no infected firmware
  • Loading branch information
wero1414 authored Sep 27, 2024
2 parents 645b2ba + 0e99762 commit 26fb572
Show file tree
Hide file tree
Showing 72 changed files with 4,924 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# options: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: chromium
IndentWidth: 2
# Must be 80 characters or less!
# ColumnLimit: 80
# does (int) x instead of (int)x
SpaceAfterCStyleCast: true
# spaces, not tabs!
UseTab: Never
#
AlignTrailingComments: true
# #define SHORT_NAME 42
# #define LONGER_NAME 0x007f # does nice spacing for macros
AlignConsecutiveMacros: Consecutive
IndentPPDirectives: BeforeHash
29 changes: 24 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,37 @@ _autosave-*
*-save.pro
*-save.kicad_pcb
fp-info-cache
hardware/**/~*.lck

# Netlist files (exported from Eeschema)
*.net

# Autorouter files (exported from Pcbnew)
*.dsn
*.ses
hardware/**/*.dsn
hardware/**/*.ses

# Exported BOM files
*.xml
*.csv
hardware/**/*.xml
hardware/**/*.csv

hardware/Template-KiCAD-Project-CI-backups/

*.zip
hardware/**/*.zip

# Visual Studio config files
.vscode/

# macOS folder attributes
/**/.DS_Store

# Firmware binaries
/**/build/
/**/managed_components/
/**/build_files/
/**/build_files.tgz
/**/build_files.zip

# IDF sdkconfig
/**/sdkconfig
/**/sdkconfig.old
/**/dependencies.lock
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "firmware/components/badge_connect"]
path = firmware/components/badge_connect
url = https://github.com/ElectronicCats/badge_connect_bin.git
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-yaml
- id: no-commit-to-branch # This hook prevents direct commits to main branch
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.2 # Use the sha / tag you want to point at
hooks:
- id: clang-format
types_or: [c++, c]
args: ['--style=file']
exclude: ^firmware/components/openthread
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
exclude: ^firmware/components/openthread
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Badge Oficial DragonJAR 2024 el primero para una conferencia en Colombia
- USB C
- Bateria Social

## How to build the firmware

Check the [Developer guide](./firmware/README.md) to learn how to build the firmware from scratch.

## Gratitude
Do you want to say thank you? Tag these companies on social networks and show them your badge, thanks to them it is possible

Expand Down
14 changes: 14 additions & 0 deletions firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

set(EXTRA_COMPONENT_DIRS $ENV{MININO_PATH}/components)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(PROJECT_VERSION_MAJOR(0))
set(PROJECT_VERSION_MINOR(1))
set(PROJECT_VERSION_PATCH(0))
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
project(minino)
37 changes: 37 additions & 0 deletions firmware/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
test_port:
@if [ -z "$(PORT)" ]; then echo "PORT is not set, please set PORT using export, example: 'export PORT=/dev/ttyACM0'"; exit 1; fi

test_minino_path:
@if [ -z "$(MININO_PATH)" ]; then echo "MININO_PATH is not set, please set MININO_PATH using export, example: 'export MININO_PATH=/path/to/minino/firmware'"; exit 1; fi

setup:
make test_minino_path
idf.py set-target esp32c6
pre-commit install

compile:
make test_minino_path
idf.py build

flash:
make test_port
idf.py -p $(PORT) flash

format:
make test_port
idf.py -p $(PORT) erase-flash

monitor:
make test_port
idf.py -p $(PORT) monitor

clean:
rm -rf build/ managed_components/
rm sdkconfig
make setup

all: flash monitor

.PHONY: test_port test_minino_path setup compile flash monitor clean all

ff: format all
Loading

0 comments on commit 26fb572

Please sign in to comment.