Files
qmk_firmware/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp
Jun Wako 1fe4406f37 Squashed 'tmk_core/' changes from 7967731..b9e0ea0
b9e0ea0 Merge commit '7fa9d8bdea3773d1195b04d98fcf27cf48ddd81d' as 'tool/mbed/mbed-sdk'
7fa9d8b Squashed 'tool/mbed/mbed-sdk/' content from commit 7c21ce5

git-subtree-dir: tmk_core
git-subtree-split: b9e0ea08cb940de20b3610ecdda18e9d8cd7c552
2015-04-24 16:26:14 +09:00

33 lines
647 B
C++

#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);
}
}