Commit Graph

10 Commits

Author SHA1 Message Date
d3894392d5 Replace clang-format with uncrustify
LLVM/clang is not used for any compilation due to it not supporting the
8-bit architectures we use (MCS-51, AVR). This means we are effectively
installing 250+ MiB of dependencies for a C formatting tool.

Replace it with uncrustify, which uses only ~600 KiB of space and has
more granular control of formatting (800+ options).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-07-03 15:58:28 -06:00
9fb08ffa46 Mark pointers as const
Resulting binaries are identical.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-18 14:27:36 -06:00
713e1d9681 Add void to function declarations with no args
SDCC 4.3.3 complains about the declaration not matching the prototype:

    error 283: function declarator with no prototype

Add `void` to the AVR functions as well, even though no warning is
issued by GCC.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:02:41 -06:00
e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00
b70a09e205 Disable clang-format for sensitive blocks
Things like macro blocks should not be auto-formatted.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00
99af8a35f5 Use explicitly sized types from stdint
Replace bare int types with stdint types. This was done with:

    grep -rwl 'int' src/ | xargs sed -i 's/\<int\>/int16_t/g'
    grep -rwl 'unsigned long' src/ | xargs sed -i 's/\<unsigned long\>/uint32_t/g'
    grep -rwl 'unsigned char' src/ | xargs sed -i 's/\<unsigned char\>/uint8_t/g'

Then reverted for *main(), putchar(), and getchar().

The Arduino declarations for parallel_main() were also corrected to
match their definitions.

SDCC does *not* generate the same code in all instances, due to `int`
being treated different than `short int`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 07:46:44 -06:00
5fd9df0ed0 Add SPDX license identifiers
Add license information to files. Mostly automated with:

    find src/ -name '*.[c,h]' | xargs sed -i '1s,^,// SPDX-License-Identifier: GPL-3.0-only\n\n,'
    find src/ -name '*.mk' | xargs sed -i '1s,^,# SPDX-License-Identifier: GPL-3.0-only\n\n,'
2020-09-17 09:17:08 -06:00
0a07213412 Implement ISP programmer firmware 2020-01-02 15:46:33 -07:00
e3aa21cae4 Add Arduino Micro and Arduino Uno 2019-09-29 21:20:03 -06:00
ded5181926 Organize into arch, board, and ec modules 2019-09-29 20:13:03 -06:00