Skip to content

Commit fba55ce

Browse files
committed
dsi: anx: fix debug macros and M4 functionality
1 parent 04aa43b commit fba55ce

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

libraries/Arduino_H7_Video/src/H7DisplayShield.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ int USBCVideoClass::init(int edidmode) {
2222
struct edid recognized_edid;
2323
int err_code = 0;
2424

25+
memset(&recognized_edid, 0, sizeof(recognized_edid));
26+
2527
//Initialization of ANX7625
2628
err_code = anx7625_init(0);
2729
if(err_code < 0) {

libraries/Arduino_H7_Video/src/anx7625.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <drivers/DigitalInOut.h>
2626
#include <drivers/I2C.h>
2727

28-
#if defined(ARDUINO_PORTENTA_H7_M7)
28+
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(PORTENTA_H7_PINS)
2929

3030
#include "dsi.h"
3131
#include "anx7625.h"
@@ -42,9 +42,12 @@
4242
#define ANXDEBUG(format, ...) \
4343
printk(BIOS_DEBUG, "%s: " format, __func__, ##__VA_ARGS__)
4444
#else
45-
#define ANXERROR(format, ...)
46-
#define ANXINFO(format, ...)
47-
#define ANXDEBUG(format, ...)
45+
#define ANXERROR(format, ...) \
46+
do { static volatile int _i = 5; _i++; } while (0)
47+
#define ANXINFO(format, ...) \
48+
do { } while (0)
49+
#define ANXDEBUG(format, ...) \
50+
do { } while (0)
4851
#endif
4952

5053
#define FLASH_LOAD_STA 0x05
@@ -506,7 +509,7 @@ int anx7625_init(uint8_t bus) {
506509
return -1;
507510
}
508511
ANXINFO("Powering on anx7625 successfull.\n");
509-
mdelay(200); // Wait for anx7625 to be stable
512+
mdelay(500); // Wait for anx7625 to be stable
510513

511514
if(anx7625_is_power_provider(0)) {
512515
ANXINFO("OTG_ON = 0 -> VBUS ON\n");

libraries/Arduino_H7_Video/src/edid.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@
4747
#define EDIDDEBUG(format, ...) \
4848
printk(BIOS_SPEW, "%s: " format, __func__, ##__VA_ARGS__)
4949
#else
50-
#define EDIDERROR(format, ...)
51-
#define EDIDWARNING(format, ...)
52-
#define EDIDDEBUG(format, ...)
50+
#define EDIDERROR(format ...) \
51+
do { } while (0)
52+
#define EDIDWARNING(format ...) \
53+
do { } while (0)
54+
#define EDIDDEBUG(format ...) \
55+
do { } while (0)
5356
#endif
5457

5558
struct edid_context {
@@ -1034,7 +1037,7 @@ parse_extension(struct edid *out, unsigned char *x, struct edid_context *c)
10341037
}
10351038

10361039
static const struct {
1037-
int x, y, refresh;
1040+
unsigned int x, y, refresh;
10381041
} established_timings[] = {
10391042
/* 0x23 bit 7 - 0 */
10401043
{720, 400, 70},

0 commit comments

Comments
 (0)