Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Rejestrator
main.cpp@1:5ad44a4edff9, 2015-05-09 (annotated)
- Committer:
- Waldek
- Date:
- Sat May 09 15:06:38 2015 +0000
- Revision:
- 1:5ad44a4edff9
- Parent:
- 0:fa31f8461c63
Correction in the magnetic measurement
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Waldek | 0:fa31f8461c63 | 1 | #include <MemoryPool.h> |
Waldek | 0:fa31f8461c63 | 2 | #include <RtosTimer.h> |
Waldek | 0:fa31f8461c63 | 3 | #include <Thread.h> |
Waldek | 0:fa31f8461c63 | 4 | #include <Queue.h> |
Waldek | 0:fa31f8461c63 | 5 | #include <mbed.h> |
Waldek | 0:fa31f8461c63 | 6 | #include "WaitForSwitch.h" |
Waldek | 0:fa31f8461c63 | 7 | #include "USBHostMSD.h" |
Waldek | 0:fa31f8461c63 | 8 | #include "Rejestrator.h" |
Waldek | 0:fa31f8461c63 | 9 | #include "H_IO.h" |
Waldek | 0:fa31f8461c63 | 10 | #include "Acquisition.h" |
Waldek | 0:fa31f8461c63 | 11 | #include "FileWritter.h" |
Waldek | 0:fa31f8461c63 | 12 | |
Waldek | 0:fa31f8461c63 | 13 | Serial pc(USBTX, USBRX); |
Waldek | 0:fa31f8461c63 | 14 | |
Waldek | 0:fa31f8461c63 | 15 | rtos::MemoryPool<struct row_type, 20> data_memory; |
Waldek | 0:fa31f8461c63 | 16 | rtos::Queue<struct row_type, 20> data_queue; |
Waldek | 0:fa31f8461c63 | 17 | |
Waldek | 0:fa31f8461c63 | 18 | enum operating_mode_type operating_mode = Starting; |
Waldek | 0:fa31f8461c63 | 19 | |
Waldek | 0:fa31f8461c63 | 20 | osStatus ErrorValue = osOK; |
Waldek | 0:fa31f8461c63 | 21 | |
Waldek | 0:fa31f8461c63 | 22 | int main(void) |
Waldek | 0:fa31f8461c63 | 23 | { |
Waldek | 0:fa31f8461c63 | 24 | pc.printf("Starting\n"); |
Waldek | 0:fa31f8461c63 | 25 | rtos::Thread HIO(ThreadIO, NULL, osPriorityBelowNormal); |
Waldek | 0:fa31f8461c63 | 26 | pc.printf("Started IO\n"); |
Waldek | 0:fa31f8461c63 | 27 | rtos::Thread::wait(500); |
Waldek | 0:fa31f8461c63 | 28 | // WaitForSwitch(Switch1, led_green); |
Waldek | 0:fa31f8461c63 | 29 | // rtos::Thread FileWriter(ThreadFileWritter, NULL, osPriorityNormal); |
Waldek | 0:fa31f8461c63 | 30 | // rtos::Thread FileWriter(ThreadFileWritter, NULL, osPriorityBelowNormal); |
Waldek | 0:fa31f8461c63 | 31 | // WaitForSwitch(Switch2, led_red); |
Waldek | 0:fa31f8461c63 | 32 | pc.printf("Starting aquisition\n"); |
Waldek | 0:fa31f8461c63 | 33 | rtos::Thread Acquisition(ThreadAcquisition, NULL, osPriorityAboveNormal); |
Waldek | 0:fa31f8461c63 | 34 | pc.printf("Started aquisition\n"); |
Waldek | 0:fa31f8461c63 | 35 | |
Waldek | 0:fa31f8461c63 | 36 | FileWritter (NULL); |
Waldek | 0:fa31f8461c63 | 37 | |
Waldek | 0:fa31f8461c63 | 38 | pc.printf("filewriter stopped\n"); |
Waldek | 0:fa31f8461c63 | 39 | |
Waldek | 0:fa31f8461c63 | 40 | // while (1) |
Waldek | 0:fa31f8461c63 | 41 | // { |
Waldek | 0:fa31f8461c63 | 42 | // slcd.display ((int)global_time); |
Waldek | 0:fa31f8461c63 | 43 | // rtos::Thread::wait(100); |
Waldek | 0:fa31f8461c63 | 44 | // } |
Waldek | 0:fa31f8461c63 | 45 | } |