-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2017-RockSat-X-Flightcode.cpp
More file actions
87 lines (65 loc) · 1.72 KB
/
2017-RockSat-X-Flightcode.cpp
File metadata and controls
87 lines (65 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <predef.h>
#include <stdio.h>
#include <ctype.h>
#include <startnet.h>
#include <autoupdate.h>
#include <smarttrap.h>
#include <string.h>
#include <NetworkDebug.h>
#include "Definitions.h"
#include "src/comm/Parallel/ParallelPort.hpp"
#include "src/comm/serial/Serial_IO.h"
#include "src/comm/serial/SD_IO.h"
#include <iosys.h>
HiResTimer* timer = HiResTimer::getHiResTimer(2);
HiResTimer* throttle = HiResTimer::getHiResTimer(3);
extern "C" {
void UserMain(void * pd);
}
const char * AppName="2017-Rocksat-X-Flightcode";
void SetupTimer()
{
timer = HiResTimer::getHiResTimer(2);
timer->clearInterruptFunction();
timer->init();
timer->start();
}
void UserMain(void * pd) {
InitializeStack();
OSChangePrio(MAIN_TASK_PRIO);
EnableAutoUpdate();
#ifndef _DEBUG
EnableSmartTraps();
#endif
#ifdef _DEBUG
//InitializeNetworkGDB();
InitializeNetworkGDB_and_Wait();
#endif
//iprintf("Testing0\r\n");
SetupTimer();
Serial_IO::initSerial();
ParallelPort::initParallel();
ParallelPort::StartParallelQueueTask();
SD_IO::StartSDWriteTask();
Serial_IO::StartSerialReadTask();
//iprintf("Testing1\r\n");
DEBUG_PRINT_NET("Waiting for IO... \r\n");
// while(1)
// {
// if(amountRead>=50)
// {
// parallelPortData = (uint8_t*)readData;
// writeData = 1;
// DEBUG_PRINT_NET("Waiting on Parallel Port Write... %2f\r\n", timer->readTime());
// OSSemPend(&finishedWriting, 0);
// DEBUG_PRINT_NET("Parallel Port Write finished... %2f\r\n", timer->readTime());
// writeData=0;
// amountRead=0;
// }
// }
//iprintf("Application started\n");
while (1) {
OSTimeDly(10*TICKS_PER_SECOND);
DEBUG_PRINT_NET("Testing... %u\r\n",ParallelPort::intCount);
}
}