Skip to content

Commit 8a10f1d

Browse files
feat: remove validation
1 parent c101cd4 commit 8a10f1d

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ Add to your `Cargo.toml`:
5454

5555
```toml
5656
[dependencies]
57-
jetpwmon = "0.1.1"
57+
jetpwmon = "0.1.2"
5858
```
5959

6060
### C/C++
6161

6262
Download the pre-built `.deb` package from the [Releases](https://github.com/yourusername/jetson-power-monitor/releases) page:
6363

6464
```bash
65-
sudo dpkg -i jetpwmon_0.1.1_amd64.deb
65+
sudo dpkg -i jetpwmon_0.1.2_amd64.deb
6666
```
6767

6868
Or use CMake to find and link the library in your project:
@@ -224,7 +224,7 @@ First, add `jetpwmon` as a dependency in your `Cargo.toml`. Adjust the path or v
224224

225225
```toml
226226
[dependencies]
227-
jetpwmon = "0.1.1"
227+
jetpwmon = "0.1.2"
228228

229229
# The examples also use these crates:
230230
ndarray = "0.15" # For matrix example
@@ -308,7 +308,7 @@ Dependencies needed for this example:
308308

309309
```toml
310310
[dependencies]
311-
jetpwmon = { version = "0.1.1" } # Adjust as needed
311+
jetpwmon = { version = "0.1.2" } # Adjust as needed
312312
ndarray = "0.15"
313313
rand = "0.8"
314314
```

README_CN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ pip install jetpwmon
5555

5656
```toml
5757
[dependencies]
58-
jetpwmon = "0.1.1"
58+
jetpwmon = "0.1.2"
5959
```
6060

6161
### C/C++
6262

6363
[Releases](https://github.com/yourusername/jetson-power-monitor/releases) 页面下载预编译的 `.deb` 包:
6464

6565
```bash
66-
sudo dpkg -i jetpwmon_0.1.1_amd64.deb
66+
sudo dpkg -i jetpwmon_0.1.2_amd64.deb
6767
```
6868

6969
或者使用 CMake 在你的项目中查找和链接库:
@@ -229,7 +229,7 @@ monitor_power_consumption(cpu_intensive_task)
229229

230230
```toml
231231
[dependencies]
232-
jetpwmon = "0.1.1"
232+
jetpwmon = "0.1.2"
233233

234234
# 示例也使用了这些crate:
235235
ndarray = "0.15" # 用于矩阵示例
@@ -312,7 +312,7 @@ fn main() -> Result<(), Error> {
312312

313313
```toml
314314
[dependencies]
315-
jetpwmon = { version = "0.1.1" } # 根据需要进行调整
315+
jetpwmon = { version = "0.1.2" } # 根据需要进行调整
316316
ndarray = "0.15"
317317
rand = "0.8"
318318
```

bindings/rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jetpwmon"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
authors = ["Qi Deng <[email protected]>"]
66
description = "Rust bindings for Jetson Power Monitor"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "jetpwmon"
7-
version = "0.1.1"
7+
version = "0.1.2"
88
description = "A simple power monitor for Jetson"
99
authors = [
1010
{ name = "Qi Deng", email = "[email protected]" }

python/jetpwmon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
jetpwmon - A simple power monitor for Jetson.
44
"""
5-
__version__ = "0.1.1" # Keep version consistent
5+
__version__ = "0.1.2" # Keep version consistent
66

77
try:
88
# Import symbols from the compiled C++ module named '_core'

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
# 示例,添加需要的编译器和链接器选项
99
cxx_std=14, # 使用C++14
1010
include_dirs=['include'],
11-
define_macros=[('VERSION_INFO', '0.1.1')],
11+
define_macros=[('VERSION_INFO', '0.1.2')],
1212
libraries=['pthread'], # 如果需要
1313
),
1414
]
1515

1616
setup(
1717
name="jetpwmon",
18-
version="0.1.1",
18+
version="0.1.2",
1919
author="Qi Deng",
2020
author_email="[email protected]",
2121
description="A simple power monitor library for Jetson",

src/jetpwmon.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,24 +1241,24 @@ static pm_error_t read_sensor_data(pm_handle_t handle)
12411241

12421242
/* Validate readings based on sensor type */
12431243
bool valid_reading = true;
1244-
if (strstr(handle->sensor_names[i], "VDD_IN"))
1245-
{
1246-
/* VDD_IN 是系统总功耗 */
1247-
if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1248-
if (current < 0.0 || current > 10000.0) valid_reading = false;
1249-
}
1250-
else if (strstr(handle->sensor_names[i], "VDD_CPU_GPU_CV"))
1251-
{
1252-
/* VDD_CPU_GPU_CV 是 CPU + GPU + CV 组合电源轨 */
1253-
if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1254-
if (current < 0.0 || current > 10000.0) valid_reading = false;
1255-
}
1256-
else if (strstr(handle->sensor_names[i], "VDD_SOC"))
1257-
{
1258-
/* VDD_SOC 是 SoC 电源轨 */
1259-
if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1260-
if (current < 0.0 || current > 10000.0) valid_reading = false;
1261-
}
1244+
// if (strstr(handle->sensor_names[i], "VDD_IN"))
1245+
// {
1246+
// /* VDD_IN 是系统总功耗 */
1247+
// if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1248+
// if (current < 0.0 || current > 10000.0) valid_reading = false;
1249+
// }
1250+
// else if (strstr(handle->sensor_names[i], "VDD_CPU_GPU_CV"))
1251+
// {
1252+
// /* VDD_CPU_GPU_CV 是 CPU + GPU + CV 组合电源轨 */
1253+
// if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1254+
// if (current < 0.0 || current > 10000.0) valid_reading = false;
1255+
// }
1256+
// else if (strstr(handle->sensor_names[i], "VDD_SOC"))
1257+
// {
1258+
// /* VDD_SOC 是 SoC 电源轨 */
1259+
// if (voltage < 18000.0 || voltage > 20000.0) valid_reading = false;
1260+
// if (current < 0.0 || current > 10000.0) valid_reading = false;
1261+
// }
12621262

12631263
if (!valid_reading)
12641264
{
@@ -1281,8 +1281,8 @@ static pm_error_t read_sensor_data(pm_handle_t handle)
12811281

12821282
/* Validate readings */
12831283
bool valid_reading = true;
1284-
if (voltage < 0.0 || voltage > 30.0) valid_reading = false;
1285-
if (current < 0.0 || current > 10.0) valid_reading = false;
1284+
// if (voltage < 0.0 || voltage > 30.0) valid_reading = false;
1285+
// if (current < 0.0 || current > 10.0) valid_reading = false;
12861286

12871287
if (!valid_reading)
12881288
{

0 commit comments

Comments
 (0)