Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: dart/pkg/lk/lib/leds.dart

Issue 1684433003: Add a small LED interface and demo app. (Closed) Base URL: git@github.com:domokit/sod.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the SoD project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 import 'dart:dartino.ffi';
6
7 final ForeignFunction _toggleLED = ForeignLibrary.main.lookup('led_toggle');
8
9 class LED {
10 final int _id;
11
12 const LED._internal(this._id);
lukechurch 2016/02/09 09:20:01 Consider an explanatory comment as to the pattern
herhut 2016/02/09 10:10:15 I think this is a very common pattern and we shoul
lukechurch 2016/02/09 10:13:53 I agree. We should describe it once, in the place
13
14 setState(bool value) {
Søren Gjesse 2016/02/09 09:16:01 Just make this a setter. And please add a getter
herhut 2016/02/09 10:10:15 Done.
15 _toggleLED.icall$2(_id, value ? 1 : 0);
16 }
17 }
18
19 const LED0 = const LED._internal(0);
20 const LED1 = const LED._internal(1);
21 const LED2 = const LED._internal(2);
22 const LED3 = const LED._internal(3);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698