Fork of Task616-mbedos54 by Nicholas Outram

Committer:
noutram
Date:
Tue Nov 07 11:56:12 2017 +0000
Revision:
5:929a37a18808
Parent:
4:1c9fde2d3d2d
Much more modularised solution, targeted at F429ZI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noutram 0:f916cefba2f4 1 #include "mbed.h"
noutram 5:929a37a18808 2 #include "sample_buffer.hpp"
noutram 5:929a37a18808 3 #include "morse_generator.hpp"
noutram 5:929a37a18808 4 #include "sample_hardware.hpp"
noutram 0:f916cefba2f4 5
noutram 0:f916cefba2f4 6 //Thread ID for the Main function (CMSIS API)
noutram 0:f916cefba2f4 7 osThreadId tidMain;
noutram 0:f916cefba2f4 8
noutram 0:f916cefba2f4 9
noutram 0:f916cefba2f4 10 //Main thread
noutram 0:f916cefba2f4 11 int main() {
noutram 4:1c9fde2d3d2d 12 Thread writer;
noutram 4:1c9fde2d3d2d 13
noutram 5:929a37a18808 14 //Power On Test - check PuTTY and the LEDs
noutram 5:929a37a18808 15 pot();
noutram 5:929a37a18808 16
noutram 0:f916cefba2f4 17 //Main thread ID
noutram 0:f916cefba2f4 18 tidMain = Thread::gettid();
noutram 0:f916cefba2f4 19
noutram 2:70084af839d3 20 //Thread for outputting mors
noutram 4:1c9fde2d3d2d 21 writer.start(morseGenerator);
noutram 1:4fb27aea76b2 22
noutram 5:929a37a18808 23 printf("Type characters to send\n");
noutram 2:70084af839d3 24 while (true) {
noutram 2:70084af839d3 25 //Read keyboard (serial port)
noutram 5:929a37a18808 26 char c = getchar();
noutram 2:70084af839d3 27 addCharacterToQueue(c);
noutram 0:f916cefba2f4 28 }
noutram 0:f916cefba2f4 29
noutram 0:f916cefba2f4 30 }
noutram 2:70084af839d3 31
noutram 5:929a37a18808 32
noutram 5:929a37a18808 33
noutram 2:70084af839d3 34