• AVR Freaks

Creating a Class in MPLAB Harmony

New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/10/04 06:51:06
  • Location: 0
  • Status: offline
2019/10/20 15:24:42 (permalink)

Creating a Class in MPLAB Harmony

I'm not sure if this is the place to post this, but I am trying to import a header file that contains a class in it. It throws an error when I try to compile it because one of my functions uses something in that class, specifically the "double bmp3_pow(double base, uint8_t power);. As you can see, I have done the recommended definition around it because it is a C++ syntax, but then it seems to comment it out and then I still get the error. Can anyone provide any advice to this end?

#ifdef __cplusplus(class)
class DFRobot_BMP388
DFRobot_BMP388(int cs);
int8_t begin();
float readTemperature();
float readPressure();
float readCalibratedAltitude(float seaLevel);
float readSeaLevel(float altitude);
float readAltitude(void);
void INTEnable();
void INTDisable();
double bmp3_pow(double base, uint8_t power);

int8_t reset();
int8_t bmp3_set_sensor_settings(uint32_t desired_settings);
int8_t bmp3_get_sensor_data(uint8_t sensor_comp, struct bmp3_data *data);
int8_t bmp3_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint16_t length);
int8_t bmp3_set_regs(uint8_t *reg_addr, const uint8_t *reg_data, uint8_t len);
int8_t set_config();
int8_t bmp3_set_op_mode();
int8_t write_power_mode();
int8_t get_calib_data();
int8_t set_pwr_ctrl_settings(uint32_t desired_settings);
void parse_sensor_data(const uint8_t *reg_data, struct bmp3_uncomp_data *uncomp_data);
int8_t compensate_data(uint8_t sensor_comp, const struct bmp3_uncomp_data *uncomp_data,struct bmp3_data *comp_data, struct bmp3_calib_data *calib_data);
void parse_calib_data(const uint8_t *reg_data);
double compensate_temperature(const struct bmp3_uncomp_data *uncomp_data,struct bmp3_calib_data *calib_data);
double compensate_pressure(const struct bmp3_uncomp_data *uncomp_data,const struct bmp3_calib_data *calib_data);
double bmp3_pow(double base, uint8_t power);

struct bmp3_dev bmp3_dev;


0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5