Advertisement
larryl79

Untitled

May 6th, 2022 (edited)
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [main.cpp]
  2. #include <PVinverter.h>
  3. // inverter lib constructor
  4. PV_INVERTER inverter(Serial2);
  5.  
  6. #include <PVinverterLCD.h>
  7. //U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 25, /* data= /R/w */ 33, /* CS=*/ 32, /* reset= */ U8X8_PIN_NONE );  // ESP32
  8. PVinverterLCD lcd( 25, 33,32, U8X8_PIN_NONE);
  9.  
  10. [....]
  11. [pvinverter.h]
  12.  
  13. class PV_INVERTER
  14. {
  15.    public:
  16. [...]
  17.  typedef struct DevStatus_t
  18.     {
  19.       bool changingFloatMode = 0 ;
  20.       bool SwitchOn = 0 ;        
  21.       bool dustProof = 0 ;        
  22.       bool SBUpriority = 0 ;      
  23.       bool ConfigStatus = 0 ;    
  24.       bool FwUpdate = 0 ;        
  25.       bool LoadStatus = 0 ;      
  26.       bool BattVoltSteady = 0 ;  
  27.       bool Chargingstatus = 0 ;    
  28.       bool SCCcharge = 0 ;          
  29.       bool ACcharge = 0 ;          
  30.     } DevStatus_t;
  31.  
  32. devStatus_t DevStatus;
  33.  
  34.  
  35. [...]
  36. [PVinverterlcd.h]
  37. #ifndef INVERTERLCD_H
  38. #define INVERTERLCD_H
  39.  
  40.   #ifndef ARDUINO_H
  41.     #include <Arduino.h>
  42.   #endif
  43.  
  44.   #include <PVinverter.h>
  45.   #include <U8g2lib.h>
  46.  
  47.   #ifdef U8X8_HAVE_HW_SPI
  48.     #include <SPI.h>
  49.   #endif
  50.  
  51. class PVinverterLCD
  52.       {
  53. [...]
  54. [PVinverterLCD.CPP]
  55.  
  56. extern struct DevStatus_t DevStatus;
  57.  
  58. void PVinverterLCD::QPIGS()
  59. {
  60.  [...]
  61.   u8g2.setFont(_INVLCD_DISP_font);
  62.   bool a = DevStatus.ACcharge;                             // error: invalid use of incomplete type 'struct DevStatus_t'
  63.   u8g2.drawStr(0,10,(const char*)a);
  64.   u8g2.sendBuffer
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement