Return bool from checkNvidia()

This commit is contained in:
jackun 2020-02-04 09:48:42 +02:00
parent 56099d1035
commit f559730d2f
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3
2 changed files with 4 additions and 2 deletions

View File

@ -9,5 +9,5 @@ extern nvmlDevice_t nvidiaDevice;
extern struct nvmlUtilization_st nvidiaUtilization;
extern bool nvmlSuccess;
void checkNvidia(void);
bool checkNvidia(void);
void getNvidiaInfo(void);

View File

@ -9,17 +9,19 @@ bool nvmlSuccess = false;
unsigned int nvidiaTemp;
struct nvmlUtilization_st nvidiaUtilization;
void checkNvidia(){
bool checkNvidia(){
if (nvml.IsLoaded()){
result = nvml.nvmlInit();
if (NVML_SUCCESS != result) {
printf("MANGOHUD: Nvidia module not loaded\n");
} else {
nvmlSuccess = true;
return true;
}
} else {
printf("Failed to load NVML!\n");
}
return false;
}
void getNvidiaInfo(){