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>
This commit is contained in:
committed by
Jeremy Soller
parent
38b2a628f9
commit
99af8a35f5
@ -5,7 +5,7 @@
|
||||
#include <board/cpu.h>
|
||||
#include <board/i2c.h>
|
||||
|
||||
void i2c_init(unsigned long baud) {
|
||||
void i2c_init(uint32_t baud) {
|
||||
TWAR = 0;
|
||||
TWBR = (uint8_t)(((F_CPU / baud) - 16 ) / 2);
|
||||
TWCR = 0;
|
||||
|
Reference in New Issue
Block a user