Skip to content

Commit 6944a29

Browse files
committed
update workflows and fix some compile issues
1 parent 81d8d26 commit 6944a29

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed

.github/workflows/arduino-action-core2-compile.yml renamed to .github/workflows/arduino-action-compile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
# You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
4141
#############################################################################################################
4242
arduino-boards-fqbn:
43-
- m5stack:esp32:core2
43+
- m5stack:esp32:m5stack_core2
4444

4545
# Specify parameters for each board.
4646
#############################################################################################################
4747
include:
48-
- arduino-boards-fqbn: m5stack:esp32:core2
48+
- arduino-boards-fqbn: m5stack:esp32:m5stack_core2
4949
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
5050
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
5151

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# M5Core2 Library
22

3-
[![Arduino Compile](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-core2-compile.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-stickc-compile.yml)
3+
[![Arduino Compile](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-compile.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-compile.yml)
44
[![Arduino Lint](https://github.com/m5stack/M5Core2/actions/workflows/Arduino-Lint-Check.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/Arduino-Lint-Check.yml)
55
[![Clang Format](https://github.com/m5stack/M5Core2/actions/workflows/clang-format-check.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/clang-format-check.yml)
66

README_cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# M5Core2 Library
22

3-
[![Arduino Compile](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-core2-compile.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-stickc-compile.yml)
3+
[![Arduino Compile](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-compile.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/arduino-action-compile.yml)
44
[![Arduino Lint](https://github.com/m5stack/M5Core2/actions/workflows/Arduino-Lint-Check.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/Arduino-Lint-Check.yml)
55
[![Clang Format](https://github.com/m5stack/M5Core2/actions/workflows/clang-format-check.yml/badge.svg)](https://github.com/m5stack/M5Core2/actions/workflows/clang-format-check.yml)
66

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/m5stack/M5Core2.git"
1212
},
13-
"version": "0.1.8",
13+
"version": "0.1.9",
1414
"frameworks": "arduino",
1515
"platforms": "espressif32",
1616
"headers": "M5Core2.h"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=M5Core2
2-
version=0.1.8
2+
version=0.1.9
33
author=M5Stack
44
maintainer=M5Stack
55
sentence=Library for M5Stack Core2 development kit

src/INA3221.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ void INA3221::setChannelEnable(ina3221_ch_t channel) {
274274
case INA3221_CH3:
275275
conf_reg.ch3_en = 1;
276276
break;
277+
default:
278+
break;
277279
}
278280

279281
_write(INA3221_REG_CONF, (uint16_t *)&conf_reg);
@@ -294,14 +296,16 @@ void INA3221::setChannelDisable(ina3221_ch_t channel) {
294296
case INA3221_CH3:
295297
conf_reg.ch3_en = 0;
296298
break;
299+
default:
300+
break;
297301
}
298302

299303
_write(INA3221_REG_CONF, (uint16_t *)&conf_reg);
300304
}
301305

302306
void INA3221::setWarnAlertShuntLimit(ina3221_ch_t channel, int32_t voltageuV) {
303-
ina3221_reg_t reg;
304-
int16_t val = 0;
307+
ina3221_reg_t reg = INA3221_REG_CONF;
308+
int16_t val = 0;
305309

306310
switch (channel) {
307311
case INA3221_CH1:
@@ -313,15 +317,17 @@ void INA3221::setWarnAlertShuntLimit(ina3221_ch_t channel, int32_t voltageuV) {
313317
case INA3221_CH3:
314318
reg = INA3221_REG_CH3_WARNING_ALERT_LIM;
315319
break;
320+
default:
321+
break;
316322
}
317323

318324
val = voltageuV / 5;
319325
_write(reg, (uint16_t *)&val);
320326
}
321327

322328
void INA3221::setCritAlertShuntLimit(ina3221_ch_t channel, int32_t voltageuV) {
323-
ina3221_reg_t reg;
324-
int16_t val = 0;
329+
ina3221_reg_t reg = INA3221_REG_CONF;
330+
int16_t val = 0;
325331

326332
switch (channel) {
327333
case INA3221_CH1:
@@ -333,6 +339,8 @@ void INA3221::setCritAlertShuntLimit(ina3221_ch_t channel, int32_t voltageuV) {
333339
case INA3221_CH3:
334340
reg = INA3221_REG_CH3_CRIT_ALERT_LIM;
335341
break;
342+
default:
343+
break;
336344
}
337345

338346
val = voltageuV / 5;
@@ -368,6 +376,8 @@ void INA3221::setCurrentSumEnable(ina3221_ch_t channel) {
368376
case INA3221_CH3:
369377
masken_reg.shunt_sum_en_ch3 = 1;
370378
break;
379+
default:
380+
break;
371381
}
372382

373383
_write(INA3221_REG_MASK_ENABLE, (uint16_t *)&masken_reg);
@@ -389,6 +399,8 @@ void INA3221::setCurrentSumDisable(ina3221_ch_t channel) {
389399
case INA3221_CH3:
390400
masken_reg.shunt_sum_en_ch3 = 0;
391401
break;
402+
default:
403+
break;
392404
}
393405

394406
_write(INA3221_REG_MASK_ENABLE, (uint16_t *)&masken_reg);
@@ -397,8 +409,8 @@ void INA3221::setCurrentSumDisable(ina3221_ch_t channel) {
397409

398410
int32_t INA3221::getShuntVoltage(ina3221_ch_t channel) {
399411
int32_t res;
400-
ina3221_reg_t reg;
401-
uint16_t val_raw = 0;
412+
ina3221_reg_t reg = INA3221_REG_CONF;
413+
uint16_t val_raw = 0;
402414

403415
switch (channel) {
404416
case INA3221_CH1:
@@ -410,6 +422,8 @@ int32_t INA3221::getShuntVoltage(ina3221_ch_t channel) {
410422
case INA3221_CH3:
411423
reg = INA3221_REG_CH3_SHUNTV;
412424
break;
425+
default:
426+
break;
413427
}
414428

415429
_read(reg, &val_raw);
@@ -494,9 +508,9 @@ float INA3221::getCurrentCompensated(ina3221_ch_t channel) {
494508
}
495509

496510
float INA3221::getVoltage(ina3221_ch_t channel) {
497-
float voltage_V = 0.0;
498-
ina3221_reg_t reg;
499-
uint16_t val_raw = 0;
511+
float voltage_V = 0.0;
512+
ina3221_reg_t reg = INA3221_REG_CONF;
513+
uint16_t val_raw = 0;
500514

501515
switch (channel) {
502516
case INA3221_CH1:
@@ -508,6 +522,8 @@ float INA3221::getVoltage(ina3221_ch_t channel) {
508522
case INA3221_CH3:
509523
reg = INA3221_REG_CH3_BUSV;
510524
break;
525+
default:
526+
break;
511527
}
512528

513529
_read(reg, &val_raw);

0 commit comments

Comments
 (0)