Skip to content

Commit

Permalink
Add VDDG_CCD
Browse files Browse the repository at this point in the history
As explained by vol2020 in #1. Also fixed memory initialisation.
  • Loading branch information
hattedsquirrel committed May 3, 2021
1 parent 280c230 commit 484fa62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/pm_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ void pm_table_0x380804(pm_table *pmt, void* base_addr) {
pmt->DETERMINISM = pm_element(135);
pmt->V_VDDM = pm_element(136);
pmt->V_VDDP = pm_element(137);
pmt->V_VDDG = pm_element(138);
pmt->V_unk1 = pm_element(139);
pmt->V_VDDG_IOD = pm_element(138);
pmt->V_VDDG_CCD = pm_element(139);

pmt->PEAK_TEMP = pm_element(140); //o
pmt->PEAK_VOLTAGE = pm_element(141); //o
Expand Down Expand Up @@ -364,8 +364,8 @@ void pm_table_0x380904(pm_table *pmt, void* base_addr) {
pmt->DETERMINISM = pm_element(135);
pmt->V_VDDM = pm_element(136);
pmt->V_VDDP = pm_element(137);
pmt->V_VDDG = pm_element(138);
pmt->V_unk1 = pm_element(139);
pmt->V_VDDG_IOD = pm_element(138);
pmt->V_VDDG_CCD = pm_element(139);
pmt->PEAK_TEMP = pm_element(140);
pmt->PEAK_VOLTAGE = pm_element(141);
pmt->unk_power = pm_element(142);
Expand Down
3 changes: 2 additions & 1 deletion src/pm_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ typedef struct {
float *V_VDDM;
float *V_VDDP;
float *V_VDDG;
float *V_unk1;
float *V_VDDG_IOD;
float *V_VDDG_CCD;
float *PEAK_TEMP;
float *PEAK_VOLTAGE;
float *unk_power;
Expand Down
6 changes: 4 additions & 2 deletions src/ryzen_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ void draw_screen(pm_table *pmt, system_info *sysinfo) {
//print_line("VDDCR_SoC", "%7.3f V", pmta(SOC_SET_VOLTAGE)); //Might be the default voltage, not the actually set one
print_line("cLDO_VDDM", "%7.4f V", pmta(V_VDDM));
print_line("cLDO_VDDP", "%7.4f V", pmta(V_VDDP));
print_line("cLDO_VDDG", "%7.4f V", pmta(V_VDDG));
if(pmt->V_VDDG) print_line("cLDO_VDDG", "%7.4f V", pmta(V_VDDG));
if(pmt->V_VDDG_IOD) print_line("cLDO_VDDG_IOD", "%7.4f V", pmta(V_VDDG_IOD));
if(pmt->V_VDDG_CCD) print_line("cLDO_VDDG_CCD", "%7.4f V", pmta(V_VDDG_CCD));
fprintf(stdout, "╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯\n");

fprintf(stdout, "╭── Power Consumption ──────────────────────────┬────────────────────────────────────────────────╮\n");
Expand Down Expand Up @@ -269,7 +271,7 @@ void draw_screen(pm_table *pmt, system_info *sysinfo) {
int select_pm_table_version(unsigned int version, pm_table *pmt, unsigned char *pm_buf) {
//Initialize pmt to 0. This also sets all pointers to 0, which signifies non-existiting fields.
//Access via pmta(...) will check if pointer is 0 before trying to access the value.
memset(pmt, 0, sizeof(pmt));
memset(pmt, 0, sizeof(pm_table));

//Select matching PM Table
switch(version) {
Expand Down

0 comments on commit 484fa62

Please sign in to comment.