@@ -27,7 +27,13 @@ static const std::map<std::string, FnCreateDispDrv> FactoryDrvDisp = {
27
27
[](int16_t dc, int16_t rst, int16_t cs, int16_t sram_cs,
28
28
int16_t busy) -> dispDrvBase * {
29
29
return new drvDispThinkInkGrayscale4Eaamfgn (dc, rst, cs, sram_cs, busy);
30
- }}};
30
+ }},
31
+ {" magtag_2025" ,
32
+ [](int16_t dc, int16_t rst, int16_t cs, int16_t sram_cs,
33
+ int16_t busy) -> dispDrvBase * {
34
+ return new drvDispThinkInkGrayscale4Eaamfgn (dc, rst, cs, sram_cs, busy);
35
+ }}
36
+ };
31
37
32
38
/* !
33
39
@brief Creates a new display driver instance based on the driver name.
@@ -50,17 +56,18 @@ dispDrvBase *CreateDrvDisp(const char *driver_name, int16_t dc, int16_t rst,
50
56
int16_t cs, int16_t sram_cs = -1 ,
51
57
int16_t busy = -1 ) {
52
58
auto it = FactoryDrvDisp.find (driver_name);
53
- if (it == FactoryDrvDisp.end ()) {
59
+ if (it == FactoryDrvDisp.end ())
54
60
return nullptr ;
55
- }
61
+
56
62
return it->second (dc, rst, cs, sram_cs, busy);
57
63
}
58
64
59
65
/* !
60
66
@brief Constructs a new DisplayHardware object
61
67
*/
62
68
DisplayHardware::DisplayHardware (const char *name) {
63
- _name = name; // /< Set the name of the hardware instance
69
+ strncpy (_name, name, sizeof (_name) - 1 );
70
+ _name[sizeof (_name) - 1 ] = ' \0 ' ;
64
71
_type = wippersnapper_display_v1_DisplayType_DISPLAY_TYPE_UNSPECIFIED;
65
72
}
66
73
0 commit comments