projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some adc function hw specific.
[bertos.git]
/
bertos
/
kern
/
kfile_test.c
diff --git
a/bertos/kern/kfile_test.c
b/bertos/kern/kfile_test.c
index 36fde490048f2157d5e5f83572a03c374a9e8eec..410243e6bb97bc73b00c7ab71d2daf534c7b5553 100644
(file)
--- a/
bertos/kern/kfile_test.c
+++ b/
bertos/kern/kfile_test.c
@@
-105,7
+105,10
@@
static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size)
* Write test buffer
*/
if (kfile_write(f, buf, size) != size)
* Write test buffer
*/
if (kfile_write(f, buf, size) != size)
+ {
+ LOG_ERR("error writing buf");
return false;
return false;
+ }
kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR);
kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR);
@@
-118,7
+121,11
@@
static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size)
* Read file in test buffer
*/
if (kfile_read(f, buf, size) != size)
* Read file in test buffer
*/
if (kfile_read(f, buf, size) != size)
+ {
+ LOG_ERR("error reading buf");
return false;
return false;
+ }
+
kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR);
kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR);
@@
-126,8
+133,13
@@
static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size)
* Check test result
*/
for (size_t i = 0; i < size; i++)
* Check test result
*/
for (size_t i = 0; i < size; i++)
+ {
if (buf[i] != (i & 0xff))
if (buf[i] != (i & 0xff))
+ {
+ LOG_ERR("error comparing at index [%d] read [%02x] expected [%02x]\n", i, buf[i], i);
return false;
return false;
+ }
+ }
return true;
}
return true;
}