blob: 2dc525cd088f971d96baa51b4e5846c732b5b49e (
plain)
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
|
#include "mbed.h"
#include "rtos.h"
#include "SDFileSystem.h"
#define FILE_LOC "/sd/test.txt"
Serial pc(USBTX, USBRX);
Serial gps(p28, p27);
Serial test(p9,p10);
SDFileSystem sd(p11, p12, p13, p14, "sd");
DigitalOut myled(LED1);
DigitalOut sdled(LED2);
void sd_thread(void const *argument) {
while (true) {
sdled = !sdled;
FILE *fp = NULL;
fp = fopen(FILE_LOC, "w");
if( fp != NULL ) fclose(fp);
Thread::wait(1000);
}
}
int main() {
Thread sdTask(sd_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE * 2.25);
while (true) {
myled = !myled;
Thread::wait(1000);
}
}
|