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.
Fork of TRP105F_Spline by
Diff: TRP105F_Spline.cpp
- Revision:
- 6:d2363b50aeaf
- Parent:
- 4:701f958d137a
- Child:
- 9:ec1ee4a6b6a4
diff -r 7d4fc0979976 -r d2363b50aeaf TRP105F_Spline.cpp
--- a/TRP105F_Spline.cpp Mon Jun 06 10:28:37 2016 +0000
+++ b/TRP105F_Spline.cpp Mon Jun 06 13:09:41 2016 +0000
@@ -697,15 +697,14 @@
{
FILE *fp;
char *filepath;
- char tmp;
int fnnum = 0;
while (filename[fnnum] != 0) fnnum++;
filepath = (char *)malloc((fnnum + 8) * sizeof(char)); // "/local/" are 7 char and \0 is 1 char.
sprintf(filepath, "/local/%s", filename);
- fp = fopen(filepath, "rb");
-
- fp = fopen("/local/log.txt", "w"); // open file in writing mode
+ fp = fopen(filepath, "w");
+ //fp = fopen("/local/log.txt", "w"); // open file in writing mode
+
fprintf(fp, "x, y,(threshold)\n");
for(int i = 0; i < _ENUM; i++) {
fprintf(fp, "%d,%d,(%d)\n", _Set[i].x, _Set[i].y, _Threshold[i]);
@@ -714,6 +713,7 @@
for(int i = 0; i < _Sample_Num; i++) {
fprintf(fp, "%d,%d\n", _Sample_Set[i].x, _Sample_Set[i].y);
}
+
free(filepath);
fclose(fp);
