Skip to content

Commit a2907d7

Browse files
committed
Merge to 1.0.3 Meha
1 parent 04bb793 commit a2907d7

File tree

16 files changed

+521
-559
lines changed

16 files changed

+521
-559
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ include $(DEVKITPRO)/libnx/switch_rules
3737
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
3838
# NACP building is skipped as well.
3939
#---------------------------------------------------------------------------------
40-
APP_TITLE := Ultra Monitor
41-
APP_VERSION := 1.0.1
40+
APP_TITLE := Status Monitor
41+
APP_VERSION := 1.0.3
4242
TARGET := $(notdir $(CURDIR))
4343
BUILD := build
4444
SOURCES := source

config/status-monitor/config.ini.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[status-monitor]
22
key_combo=L+R+DUP
3+
battery_avg_iir_filter=false
4+
battery_time_left_refreshrate=60
35

46
[full]
57
refresh_rate=1
@@ -51,5 +53,5 @@ fps_counter_color=#4444
5153
border_color=#F77F
5254
dashed_line_color=#8888
5355
main_line_color=#FFFF
54-
rounded_line_color=#0C0F
55-
perfect_line_color=#F0FF
56+
rounded_line_color=#F0FF
57+
perfect_line_color=#0C0F

docs/config.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Colors are provided in RGBA4444 format, which means that each character represen
1212
| Key | Explanation | Possible values | Default Value |
1313
|-----|-------------|-----------------|---------------|
1414
| `key_combo` | Buttons combination that allows exiting Full, Mini and Micro modes; max 4 buttons, otherwise next buttons will be ignored. Combine different buttons with `+` | `A`, `B`, `X`, `Y`, `L`, `R`, `ZL`, `ZR`, `PLUS`, `MINUS`, `DUP`, `DDOWN`, `DLEFT`, `DRIGHT`, `SL`, `SR`, `LSTICK`, `RSTICK`, `UP`, `DOWN`, `LEFT`, `RIGHT` | `L+DDOWN+RSTICK` |
15+
| `battery_avg_iir_filter` | Read voltage + current averages directly from fuel gauge, that uses infinite impulse response filter | `true`, `false` | `false` |
16+
| `battery_time_left_refreshrate` | How many seconds must pass to refresh Battery Remaining Time | from `1` to `60` | `60` |
17+
1518

1619
> [full]
1720

docs/modes.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,27 @@ For additional functions you need to install:
99

1010
This mode you can know from older releases of Status Monitor. It contains all informations properly described and supported with high precision.
1111

12-
| Category | Format | Explanation |
13-
|-----------|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14-
| CPU Usage | Frequency: %.1f (Δ%+.1f)<br>Core #0: %.2f<br>Core #1: %.2f<br>Core #2: %.2f<br>Core #3: %.2f | Targete clockrate of all CPU cores in MHz (^1)<br>Load of CPU Core #0 calculated from IdleTickCount to percent value<br>Load of CPU Core #1 calculated from IdleTickCount to percent value<br>Load of CPU Core #2 calculated from IdleTickCount to percent value<br>Load of CPU Core #3 calculated from IdleTickCount to percent value |
15-
| GPU Usage | Frequency: %.1f (Δ%+.1f)<br>Load: %.1f | Target clockrate of GPU in MHz (^1)<br>GPU Load provided by PMU in percent |
16-
| RAM Usage | - Real Frequency: %.1f (Δ%+.1f)<br>- Target Frequency: %.1f<br>- Load: %.1f (CPU %.1f \| GPU %.1f)`^1`<br>- %s: %.2f/%.2f | - Real clockrate of EMC in MHz `(^1)`<br>- Target clockrate of EMC in MHz<br>- RAM Load in % (Which part of that are CPU and GPU (with other hardware, but their impact on GPU readings is negligible) `(^1)`<br>- %s memory used/%s memory available in MB (not working with FW <5.0.0) |
17-
| Board | Battery Power Flow: %+.2f[h:mm]<br>Temperatures:<br>- SoC: %.1f <br>- PCB: %.1f <br>- Skin: %.1f<br>Fan Rotation Level: %.1f | How much power in watts is discharged from or charged to the battery [time left before shutdown]<br>SoC temperature in Celsius degrees<br>PCB temperature in Celsius degrees<br>Skin temperature in Celsius degrees (^2)<br>Fan rotation level in percent |
18-
19-
- ^1 - This shows only when sys-clk 2.0.0_rc4+ is installed.
20-
- ^2 - Explanation provided at the end of file
12+
- CPU Usage
13+
- Real Frequency: `%.1f` = Real clockrate of all CPU cores in MHz (This shows only when sys-clk 2.0.0_4c+ is installed)
14+
- Target Frequency: `%.1f` = Target clockrate of all CPU cores in MHz
15+
- Core #0-#3: `%.2f` = Load of CPU Cores calculated from IdleTickCount to percent value
16+
17+
- GPU Usage
18+
- Real Frequency: `%.1f` = Real clockrate of GPU in MHz (This shows only when sys-clk 2.0.0_rc4+ is installed)
19+
- Target Frequency: `%.1f` = Target clockrate of GPU in MHz
20+
- Load: `%.1f` = GPU Load provided by PMU in percent
21+
22+
- RAM Usage
23+
- Real Frequency: `%.1f` = Real clockrate of EMC in MHz (This shows only when sys-clk 2.0.0_rc4+ is installed)
24+
- Target Frequency: `%.1f` = Target clockrate of EMC in MHz
25+
- Load: `%.1f` (CPU `%.1f` | GPU `%.1f`) = RAM Load in % (Which part of that are CPU and GPU (with other hardware, but their impact on GPU readings is negligible))
26+
- `%s`: `%.2f`/`%.2f` = %s memory used/%s memory available in MB (not working with FW <5.0.0)
27+
28+
- Board
29+
- Battery Power Flow: `%+.2f`[h:mm] = How much power in watts is discharged from or charged to the battery [time left before shutdown]
30+
- Temperatures: SoC: `%.1f` / PCB: `%.1f` / Skin: `%.1f` = SoC / PCB / Skin temperature in Celsius degrees (Explanation provided at the end of file)
31+
- Fan Rotation Level: `%.1f` = Fan rotation level in percent
32+
2133

2234
```Optional (shows only when SaltyNX is installed and game is running)```
2335

@@ -102,14 +114,15 @@ Mode available only with SaltyNX installed.
102114

103115
> Battery
104116
105-
| Category | Format | Explanation |
106-
|---------------------------------|-----------|-----------------------------------------------------------------------------------------------|
107-
| Battery Temperature | %.2f | Battery temperature in Celsius |
108-
| Battery Raw Charge | %.2f | Raw battery charged capacity in percent |
109-
| Battery Voltage (AVG of 5) | %.2f | Battery average voltage in mV taken from 5 readings in period of 5 seconds |
110-
| Battery Current Flow (AVG of 5) | %+.2f | Battery average current flow in mA taken from 5 readings in period of 5 seconds |
111-
| Battery Power Flow (AVG of 5) | %+.3f | Battery average power flow in W calciulated from Battery Voltage and Battery Current Flow |
112-
| Battery Remaining Time | h:mm | How much time is left before shutdown |
117+
- Battery Actual Capacity: `%d` = Battery Designed Capacity multiplied by Battery Age in mAh
118+
- Battery Designed Capacity: `%d` = Battery capacity targeted by manufacturer in mAh
119+
- Battery Temperature: `%.1f` = Battery temperature in Celsius
120+
- Battery Raw Charge: `%.1f` = Raw battery charged capacity in percent
121+
- Battery Age: `%.1f` = How much of designed capacity was charged last time battery was charged completely in percent
122+
- Battery Voltage: `%.0f` = Battery average voltage in mV (time period: 5s, or with `battery_avg_iir_filter` enabled: 45s)
123+
- Battery Current Flow: `%+.0f` = Battery average current flow in mA (time period: 5s, or with `battery_avg_iir_filter` enabled: 11.25s)
124+
- Battery Power Flow: `%+.3f` = Battery average power flow in W calculated from Battery Voltage and Battery Current Flow
125+
- Battery Remaining Time: h:mm - How much time is left before shutdown
113126

114127
Shows only if charger is connected:
115128
| Category | Format | Explanation |

include/i2c.h

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,52 @@ constexpr float max17050CGain = 1.99993;
1010

1111
Result I2cReadRegHandler(u8 reg, I2cDevice dev, u16 *out)
1212
{
13-
// I2C Bus Communication Reference: https://www.ti.com/lit/an/slva704/slva704.pdf
14-
struct { u8 reg; } __attribute__((packed)) cmd;
15-
struct { u16 val; } __attribute__((packed)) rec;
13+
struct readReg {
14+
u8 send;
15+
u8 sendLength;
16+
u8 sendData;
17+
u8 receive;
18+
u8 receiveLength;
19+
};
1620

1721
I2cSession _session;
1822

1923
Result res = i2cOpenSession(&_session, dev);
2024
if (res)
2125
return res;
2226

23-
cmd.reg = reg;
24-
res = i2csessionSendAuto(&_session, &cmd, sizeof(cmd), I2cTransactionOption_All);
25-
if (res)
26-
{
27-
i2csessionClose(&_session);
28-
return res;
29-
}
27+
u16 val;
3028

31-
res = i2csessionReceiveAuto(&_session, &rec, sizeof(rec), I2cTransactionOption_All);
29+
struct readReg readRegister = {
30+
.send = 0 | (I2cTransactionOption_Start << 6),
31+
.sendLength = sizeof(reg),
32+
.sendData = reg,
33+
.receive = 1 | (I2cTransactionOption_All << 6),
34+
.receiveLength = sizeof(val),
35+
};
36+
37+
res = i2csessionExecuteCommandList(&_session, &val, sizeof(val), &readRegister, sizeof(readRegister));
3238
if (res)
3339
{
3440
i2csessionClose(&_session);
3541
return res;
3642
}
3743

38-
*out = rec.val;
44+
*out = val;
3945
i2csessionClose(&_session);
4046
return 0;
4147
}
4248

43-
bool Max17050ReadReg(u8 reg, u16 *out)
49+
Result Max17050ReadReg(u8 reg, u16 *out)
4450
{
4551
u16 data = 0;
4652
Result res = I2cReadRegHandler(reg, I2cDevice_Max17050, &data);
4753

48-
if (res)
54+
if (R_FAILED(res))
4955
{
50-
*out = res;
51-
return false;
56+
return res;
5257
}
5358

5459
*out = data;
55-
return true;
56-
}
60+
return res;
61+
}

include/max17050.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define MAXIM17050_I2C_ADDR 0x36
4343
*/
4444

45+
#define MAX17050_WAIT_NS 1175800000
46+
4547

4648
enum MAX17050_reg {
4749
MAX17050_STATUS = 0x00,

0 commit comments

Comments
 (0)