Skip to content

Commit

Permalink
Now supports multiple targets
Browse files Browse the repository at this point in the history
A makefile has been adde to automate the build process, and put all the
firmware variants in a `dist` directory, ready to use.
  • Loading branch information
virtualabs committed Aug 21, 2018
1 parent 8389b71 commit 2d05735
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
YOTTA=yt

all: ble400 microbit

ble400: dist .yotta.json
$(YOTTA) build --config config/ble400.json
cp build/bbc-microbit-classic-gcc/source/ubit-ble-sniffer-combined.hex dist/btlejack-firmware-ble400.hex
$(YOTTA) clean

microbit: dist .yotta.json
$(YOTTA) build
cp build/bbc-microbit-classic-gcc/source/ubit-ble-sniffer-combined.hex dist/btlejack-firmware-microbit.hex
$(YOTTA) clean

dist:
@mkdir -p dist
@rm dist/* -rf

.yotta.json:
$(YOTTA) target bbc-microbit-classic-gcc

clean:
$(YOTTA) clean
rm dist/ -rf
rm .yotta.json
4 changes: 4 additions & 0 deletions config/ble400.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"rxpin": "P0_9",
"txpin": "P0_11"
}
8 changes: 8 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,14 @@ int main() {

/* Initalize Micro:Bit and serial link. */
uBit.init();

#ifdef YOTTA_CFG_TXPIN
#ifdef YOTTA_CFG_RXPIN
#pragma message("Btlejack firmware will use custom serial pins")
uBit.serial.redirect(YOTTA_CFG_TXPIN, YOTTA_CFG_RXPIN);
#endif
#endif

pLink = new Link(&uBit);

/* Init BLE timer. */
Expand Down

0 comments on commit 2d05735

Please sign in to comment.