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
@@ -66,7 +66,7 @@ uint8_t dgpu_get_fan_duty(void) {
|
||||
if (power_state == POWER_STATE_S0 && gpio_get(&DGPU_PWR_EN) && !gpio_get(&GC6_FB_EN)) {
|
||||
// Use I2CS if in S0 state
|
||||
int8_t rlts;
|
||||
int res = i2c_get(&I2C_DGPU, 0x4F, 0x00, &rlts, 1);
|
||||
int16_t res = i2c_get(&I2C_DGPU, 0x4F, 0x00, &rlts, 1);
|
||||
if (res == 1) {
|
||||
dgpu_temp = (int16_t)rlts;
|
||||
duty = fan_duty(&FAN, dgpu_temp);
|
||||
|
Reference in New Issue
Block a user