Implemented PINOUT.TXT file

This commit is contained in:
2018-01-07 13:04:19 +01:00
parent ad39fc280f
commit 26934a0984
15 changed files with 217 additions and 63 deletions
-1
View File
@@ -39,7 +39,6 @@
X(NOT_APPLICABLE, NULL) \
X(HW_TIMEOUT, NULL) \
X(NO_SUCH_UNIT, NULL) \
X(OVERRUN, NULL) /* used in bulk transfer */ \
X(PROTOCOL_BREACH, NULL) /* eating with the wrong spoon */ \
X(BAD_UNIT_TYPE, NULL) \
X(NOT_IMPLEMENTED, NULL) \
+7
View File
@@ -91,3 +91,10 @@ void iw_entry(IniWriter *iw, const char *key, const char *format, ...)
IW_VPRINTF();
iw_newline(iw); // one newline after entry
}
uint32_t iw_measure_total(void (*handler)(IniWriter *))
{
IniWriter iw = iw_init(NULL, 0xFFFFFFFF, 1);
handler(&iw);
return 0xFFFFFFFF - iw.skip;
}
+8
View File
@@ -97,4 +97,12 @@ __attribute__((format(printf,2,3)));
void iw_entry(IniWriter *iw, const char *key, const char *format, ...)
__attribute__((format(printf,3,4)));
/**
* Measure total ini writer length using a dummy write
*
* @param handler - function that normally writes to the writer
* @return byte count
*/
uint32_t iw_measure_total(void (*handler)(IniWriter *));
#endif //INIWRITER_H