Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9e1757

Browse files
Merge pull request#1015 from dmazzella/patch-1
Arduino_H7_Video: handling errors at initialization time
2 parentsf9744ff +0255e38 commitd9e1757

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

‎libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ int Arduino_H7_Video::begin() {
9595
#endif
9696

9797
/* Video controller/bridge init*/
98-
_shield->init(_edidMode);
98+
int err_code = _shield->init(_edidMode);
99+
if (err_code <0) {
100+
return3;/* Video controller fail init*/
101+
}
99102

100103
#if __has_include("lvgl.h")
101104
/* Initiliaze LVGL library*/

‎libraries/Arduino_H7_Video/src/H7DisplayShield.cpp‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,22 @@ int USBCVideoClass::init(int edidmode) {
3131
}
3232

3333
//Checking HDMI plug event
34-
anx7625_wait_hpd_event(0);
34+
err_code =anx7625_wait_hpd_event(0);
35+
if(err_code <0) {
36+
return err_code;
37+
}
3538

3639
//Read EDID
37-
anx7625_dp_get_edid(0, &recognized_edid);
40+
err_code =anx7625_dp_get_edid(0, &recognized_edid);
41+
if(err_code <0) {
42+
return err_code;
43+
}
3844

3945
//DSI Configuration
40-
anx7625_dp_start(0, &recognized_edid, (enum edid_modes) edidmode);
46+
err_code =anx7625_dp_start(0, &recognized_edid, (enum edid_modes) edidmode);
47+
if(err_code <0) {
48+
return err_code;
49+
}
4150

4251
return0;
4352
}

‎libraries/Arduino_H7_Video/src/anx7625.cpp‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,21 @@ int anx7625_init(uint8_t bus) {
520520
return0;
521521
}
522522

523-
voidanx7625_wait_hpd_event(uint8_t bus) {
523+
intanx7625_wait_hpd_event(uint8_t bus) {
524524
ANXINFO("Waiting for HDMI hot plug event...\n");
525-
526-
while (1) {
525+
526+
int retry_hpd_change =10000;
527+
while (--retry_hpd_change) {
527528
mdelay(10);
528529
int detected =anx7625_hpd_change_detect(bus);
529-
if (detected ==1)
530-
break;
530+
if (detected <0)
531+
return -1;
532+
if (detected >0)
533+
return0;
531534
}
535+
536+
ANXERROR("Timed out to detect HPD change on bus %d.\n", bus);
537+
return -1;
532538
}
533539

534540
intanx7625_get_cc_status(uint8_t bus,uint8_t *cc_status) {

‎libraries/Arduino_H7_Video/src/anx7625.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern "C" {
2020
intanx7625_dp_start(uint8_tbus,conststructedid*edid,enumedid_modesmode=EDID_MODE_AUTO);
2121
intanx7625_dp_get_edid(uint8_tbus,structedid*out);
2222
intanx7625_init(uint8_tbus);
23-
voidanx7625_wait_hpd_event(uint8_tbus);
23+
intanx7625_wait_hpd_event(uint8_tbus);
2424
intanx7625_get_cc_status(uint8_tbus,uint8_t*cc_status);
2525
intanx7625_read_system_status(uint8_tbus,uint8_t*sys_status);
2626
boolanx7625_is_power_provider(uint8_tbus);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp