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

Side by Side Diff: platforms/stm/disco_fletch/src/test.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments 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
« no previous file with comments | « platforms/stm/disco_fletch/src/syscalls.c ('k') | platforms/stm/disco_fletch/src/uart.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino 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:typed_data';
6
7 import 'package:stm32f746g_disco/uart.dart';
8 import 'package:stm32f746g_disco/stm32f746g_disco.dart';
9
10 main() {
11 const int CR = 13;
12 const int LF = 10;
13
14 STM32F746GDiscovery disco = new STM32F746GDiscovery();
15 Uart uart = disco.uart;
16
17 uart.writeString("\rWelcome to Dart UART echo!\r\n");
18 uart.writeString("--------------------------\r\n");
19 while (true) {
20 var data = new Uint8List.view(uart.readNext());
21 // Map CR to CR+LF for nicer console output.
22 if (data.indexOf(CR) != -1) {
23 for (int i = 0; i < data.length; i++) {
24 var byte = data[i];
25 uart.writeByte(byte);
26 if (byte == CR) {
27 uart.writeByte(LF);
28 }
29 }
30 } else {
31 uart.write(data.buffer);
32 }
33 }
34 }
OLDNEW
« no previous file with comments | « platforms/stm/disco_fletch/src/syscalls.c ('k') | platforms/stm/disco_fletch/src/uart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698