Skip to content

Commit e5b3996

Browse files
authored
Merge pull request #163 from c-base/microflo-06
Update to microflo 0.6
2 parents c14ae01 + 63a43bf commit e5b3996

7 files changed

+15
-74
lines changed

Gruntfile.coffee

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ microflo_gen = (name, options={}) ->
6262
target: 'linux'
6363
out: "build/#{options.target||'linux'}/#{name}/#{name}.#{options.ext||'cpp'}"
6464
graph: "graphs/#{name}.fbp"
65-
library: "./components-#{name}.json"
65+
components: ["./node_modules/microflo-core/components", "./node_modules/microflo-arduino/components/LedChainWS.hpp"]
6666
for k,v of defaults
6767
options[k] = v if not options[k]?
6868

@@ -75,10 +75,13 @@ microflo_gen = (name, options={}) ->
7575
fs.mkdirSync path.join(dir,'builder') if not fs.existsSync path.join(dir,'builder')
7676
cmd = [
7777
options.microflo,
78-
'--target', options.target
79-
'--library', options.library
8078
'generate', options.graph, options.out
79+
'--target', options.target
8180
]
81+
82+
for c in options.components
83+
cmd = cmd.concat(['--components', c])
84+
8285
return cmd.join(' ')
8386

8487
microflo_compile = (name, options={}) ->
@@ -175,15 +178,15 @@ module.exports = ->
175178
tablelights_run: './spec/microflo-linux.sh TableLights 4444 & sleep 5'
176179
portallights_arduino_gen: microflo_gen 'PortalLights', { target: 'arduino', ext: 'ino.tmpl' }
177180
portallights_arduino_build: arduino_build 'PortalLights',
178-
board: 'arduino:avr:uno'
181+
board: 'arduino:avr:leonardo'
179182
ext: 'ino'
180183
portallights_linux_gen: microflo_gen 'PortalLights'
181184
portallights_linux_comp: microflo_compile 'PortalLights'
182185
portallights_run: './spec/microflo-linux.sh PortalLights 5555 & sleep 5'
183186
kill_microflo_linux:
184187
options: { shell: '/bin/bash' }
185188
command: 'pkill microflo-linux || echo no processes to kill'
186-
flash_arduino: flash_avr 'build/arduino/PortalLights/builder/PortalLights.ino.hex', { board: 'arduino:avr:uno' }
189+
flash_arduino: flash_avr 'build/arduino/PortalLights/builder/PortalLights.ino.hex', { board: 'arduino:avr:leonardo' }
187190

188191
# Grunt plugins used for building
189192
@loadNpmTasks 'grunt-exec'

components-PortalLights.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

components-TableLights.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"dependencies": {
1111
"google-auth-library": "~0.12.0",
12-
"microflo": "~0.5.0",
12+
"microflo": "~0.6.0",
1313
"noflo": "~1.0.0",
1414
"noflo-core": "~0.5.0",
1515
"noflo-filesystem": "~2.0.0",
@@ -30,14 +30,15 @@
3030
"grunt-mocha-test": "^0.13.2",
3131
"grunt-noflo-lint": "^0.3.0",
3232
"grunt-string-replace": "^1.3.1",
33-
"microflo-core": "^0.3.38",
33+
"microflo-core": "^0.6.0",
34+
"microflo-arduino": "^0.6.0",
3435
"mocha": "^4.0.0",
3536
"noflo-nodejs": "^0.9.0"
3637
},
3738
"scripts": {
3839
"test": "grunt test",
3940
"start": "./node_modules/.bin/noflo-nodejs --register=false --graph graphs/main.json --secret=ingress --catch-exceptions=false --cache=true",
40-
"portallights": "./node_modules/.bin/microflo runtime --port 5555 --graph graphs/PortalLights.fbp --componentmap build/arduino/PortalLights/componentlib-map.json --serial /dev/ttyACM0 --baudrate 9600",
41+
"portallights": "./node_modules/.bin/microflo runtime --port 5555 --graph graphs/PortalLights.fbp --componentmap build/arduino/PortalLights/main.component.map.json --serial /dev/ttyACM0 --baudrate 9600",
4142
"postinstall": "./node_modules/.bin/noflo-cache-preheat"
4243
},
4344
"noflo": {

spec/microflo-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PORT=$2
44

55
FIRMWARE_FILE=build/linux/$NAME/$NAME
66
SERIAL_FILE=test.$NAME.microflo
7-
COMPONENT_MAP=build/linux/$NAME/componentlib-map.json
7+
COMPONENT_MAP=build/linux/$NAME/$NAME.component.map.json
88
OPTIONS="--port $PORT --baudrate 115200 --serial $SERIAL_FILE --graph graphs/$NAME.fbp"
99

1010
# Make sure we clean up

systemd/microflo-portallights.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Service]
22
WorkingDirectory=/opt/ingress-table
3-
ExecStart=/usr/bin/node --max-old-space-size=100 ./node_modules/.bin/microflo runtime --port 5555 --graph graphs/PortalLights.fbp --componentmap build/arduino/PortalLights/componentlib-map.json --serial /dev/ttyACM0 --baudrate 9600
3+
ExecStart=/usr/bin/node --max-old-space-size=100 ./node_modules/.bin/microflo runtime --port 5555 --graph graphs/PortalLights.fbp --componentmap build/arduino/PortalLights/PortalLights.component.map.json --serial /dev/ttyACM0 --baudrate 9600
44
Restart=always
55
User=bergie
66

systemd/microflo-streetlights.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Service]
22
WorkingDirectory=/opt/ingress-table
3-
ExecStart=/usr/bin/node --max-old-space-size=100 ./node_modules/.bin/microflo runtime --port 4444 --graph graphs/TableLights.fbp --componentmap build/arduino/TableLights/componentlib-map.json --serial /dev/ttyACM1 --baudrate 115200
3+
ExecStart=/usr/bin/node --max-old-space-size=100 ./node_modules/.bin/microflo runtime --port 4444 --graph graphs/TableLights.fbp --componentmap build/arduino/TableLights/TableLights.component.map.json --serial /dev/ttyACM1 --baudrate 115200
44
#ExecStart=/opt/ingress-table/spec/microflo-linux.sh TableLights 4444
55
Restart=always
66
User=bergie

0 commit comments

Comments
 (0)