Skip to content

T1000-E: Negative temperature values incorrectly displayed due to char signedness #1389

@R6DJO

Description

@R6DJO

Description

The T1000-E sensor variant has a bug that causes negative temperature values to be displayed incorrectly.

Root Cause

The ntc_temp2 lookup table in variants/t1000-e/t1000e_sensors.cpp is declared as char type:

static char ntc_temp2[136] = {
  -30, -29, -28, -27, -26, -25, -24, ...

On some architectures/compilers, char is unsigned by default, which causes negative temperature values (from -30°C to -1°C) to be interpreted incorrectly.

Solution

Change the array type from char to int8_t to ensure signed interpretation:

static int8_t ntc_temp2[136] = {
  -30, -29, -28, -27, -26, -25, -24, ...

Impact

  • Affects temperature readings in cold environments (below 0°C)
  • Temperature readings may show incorrect values when the actual temperature is negative

Fix

A PR will follow with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions