fix fp conversion
This commit is contained in:
5
gddr6.c
5
gddr6.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
|
|||||||
(void) argc;
|
(void) argc;
|
||||||
(void) argv;
|
(void) argv;
|
||||||
void *virt_addr;
|
void *virt_addr;
|
||||||
double temp;
|
uint32_t temp;
|
||||||
uint32_t phys_addr;
|
uint32_t phys_addr;
|
||||||
uint32_t read_result;
|
uint32_t read_result;
|
||||||
uint32_t base_offset;
|
uint32_t base_offset;
|
||||||
@@ -161,6 +161,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
close(fd);
|
close(fd);
|
||||||
|
printf("Can't read memory. If you are root, enable kernel parameter iomem=relaxed\n");
|
||||||
PRINT_ERROR();
|
PRINT_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +171,7 @@ int main(int argc, char **argv)
|
|||||||
read_result = *((uint32_t *) virt_addr);
|
read_result = *((uint32_t *) virt_addr);
|
||||||
temp = ((read_result & 0x00000fff) / 0x20);
|
temp = ((read_result & 0x00000fff) / 0x20);
|
||||||
|
|
||||||
printf("\r%s VRAM Temp: %.1f°c", device->vram, temp);
|
printf("\r%s VRAM Temp: %.1u°c", device->vram, temp);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user