Browse Source

Got compiling and building from the CLI working

master
Macoy Madson 10 months ago
parent
commit
e76caae166
  1. 18
      Build.sh
  2. 8
      COPYING
  3. 1
      Dependencies/cakelisp
  4. 9
      ReadMe.org
  5. 23
      src/DrinkCounter.cake
  6. 7
      src/Main.cake

18
Build.sh

@ -4,15 +4,25 @@ CAKELISP_DIR=Dependencies/cakelisp
# Build Cakelisp itself
echo "\n\nCakelisp\n\n"
cd $CAKELISP_DIR
cd $CAKELISP_DIR || exit $?
./Build.sh || exit $?
cd ../..
echo "\n\nGameLib Project\n\n"
echo "\n\nDrink Counter\n\n"
CAKELISP=./Dependencies/cakelisp/bin/cakelisp
$CAKELISP --verbose-processes --execute \
# Arduino will build our file
$CAKELISP --verbose-processes --skip-build \
src/Config_Linux.cake \
src/Main.cake || exit $?
src/DrinkCounter.cake || exit $?
# Arduino build expects things to have specific names and extensions
mv cakelisp_cache/DrinkCounter/DrinkCounter.cake.c cakelisp_cache/DrinkCounter/DrinkCounter.ino || exit $?
/media/macoy/Preserve/Programs/arduino-cli_0.29.0-rc.1_Linux_64bit/arduino-cli --no-color \
compile -b arduino:avr:uno ./cakelisp_cache/DrinkCounter/DrinkCounter.ino || exit $?
/media/macoy/Preserve/Programs/arduino-cli_0.29.0-rc.1_Linux_64bit/arduino-cli --no-color \
upload -b arduino:avr:uno --port /dev/ttyACM0 ./cakelisp_cache/DrinkCounter || exit $?

8
COPYING

@ -1,16 +1,16 @@
Copyright (c) 2021 Macoy Madson
This file is part of GameLib Project.
This file is part of Drink Counter.
GameLib Project is free software: you can redistribute it and/or modify
Drink Counter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GameLib Project is distributed in the hope that it will be useful,
Drink Counter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GameLib Project. If not, see <https://www.gnu.org/licenses/>.
along with Drink Counter. If not, see <https://www.gnu.org/licenses/>.

1
Dependencies/cakelisp

@ -0,0 +1 @@
Subproject commit 37e56378c017ae8f895ecf66c0f7891eeb2651ff

9
ReadMe.org

@ -1,3 +1,8 @@
#+title: GameLib Project
#+title: Drink Counter
This is a template repository for gamelib-based projects.
Currently an Arduino project for helping me count my drinks.
* Setup
- Download the [[https://github.com/arduino/arduino-cli/releases][Arduino CLI]]. There may be more steps because I had installed the IDE first before I found the CLI.
- Update ~Build.sh~ to point to the Arduino CLI install.

23
src/DrinkCounter.cake

@ -0,0 +1,23 @@
;; Arduino build expects things to have specific names and extensions. We'll create a build label
;; just to make our build directory match, which appears to be necessary.
(add-build-config-label "DrinkCounter")
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
;; (add-cakelisp-search-directory "Dependencies/gamelib/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(add-cakelisp-search-directory "src")
(import "CHelpers.cake")
(defun setup ()
(pinMode LED_BUILTIN OUTPUT))
(defun loop ()
;; turn the LED on (HIGH is the voltage level)
(digitalWrite LED_BUILTIN HIGH)
;; wait for a second
(delay 10000)
;; turn the LED off by making the voltage LOW
(digitalWrite LED_BUILTIN LOW)
;; wait for a second
(delay 1000))

7
src/Main.cake

@ -1,7 +0,0 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "Dependencies/gamelib/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(add-cakelisp-search-directory "src")
(defun main (&return int)
(return 0))
Loading…
Cancel
Save