refactoring

This commit is contained in:
Devaev Maxim 2019-02-21 08:02:21 +03:00
parent 9ca511d29d
commit ce6184b8cd
4 changed files with 571 additions and 569 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
/*****************************************************************************
# #
# uStreamer - Lightweight and fast MJPG-HTTP streamer. #
# #
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #

View File

@ -441,10 +441,10 @@ static int _device_apply_resolution(struct device_t *dev, const unsigned width,
static const char *_format_to_string_auto(char *buf, const size_t size, const unsigned format) {
assert(size >= 8);
buf[0] = format & 0x7f;
buf[1] = (format >> 8) & 0x7f;
buf[2] = (format >> 16) & 0x7f;
buf[3] = (format >> 24) & 0x7f;
buf[0] = format & 0x7F;
buf[1] = (format >> 8) & 0x7F;
buf[2] = (format >> 16) & 0x7F;
buf[3] = (format >> 24) & 0x7F;
if (format & (1 << 31)) {
buf[4] = '-';
buf[5] = 'B';

View File

@ -42,7 +42,7 @@ def main():
for ch in jpg_data:
if len(rows[-1]) > 20:
rows.append([])
rows[-1].append(hex(ch))
rows[-1].append("0x%.2X" % (ch))
text = ",\n\t".join(", ".join(row) for row in rows)
text = "const unsigned char %s_JPG_DATA[] = {\n\t%s\n};\n" % (prefix, text)