@@ -27,7 +27,13 @@ static const std::map<std::string, FnCreateDispDrv> FactoryDrvDisp = {
2727 [](int16_t dc, int16_t rst, int16_t cs, int16_t sram_cs,
2828 int16_t busy) -> dispDrvBase * {
2929 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+ };
3137
3238/* !
3339 @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,
5056 int16_t cs, int16_t sram_cs = -1 ,
5157 int16_t busy = -1 ) {
5258 auto it = FactoryDrvDisp.find (driver_name);
53- if (it == FactoryDrvDisp.end ()) {
59+ if (it == FactoryDrvDisp.end ())
5460 return nullptr ;
55- }
61+
5662 return it->second (dc, rst, cs, sram_cs, busy);
5763}
5864
5965/* !
6066 @brief Constructs a new DisplayHardware object
6167*/
6268DisplayHardware::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 ' ;
6471 _type = wippersnapper_display_v1_DisplayType_DISPLAY_TYPE_UNSPECIFIED;
6572}
6673
0 commit comments