fix silly build errors

custom
jacqueline 3 years ago
parent 8b10a44106
commit 353df98ba1
  1. 4
      main/battery.cpp
  2. 6
      main/battery.h
  3. 4
      main/gay-ipod-fw.cpp

@ -1,4 +1,4 @@
#include "battery.c" #include "battery.h"
#include "driver/adc.h" #include "driver/adc.h"
#include "esp_adc_cal.h" #include "esp_adc_cal.h"
@ -8,7 +8,7 @@ namespace gay_ipod {
static esp_adc_cal_characteristics_t calibration; static esp_adc_cal_characteristics_t calibration;
esp_error_t init_adc(void) { esp_err_t init_adc(void) {
// Calibration should already be fused into the chip from the factory, so // Calibration should already be fused into the chip from the factory, so
// we should only need to read it back out again. // we should only need to read it back out again.
esp_adc_cal_characterize( esp_adc_cal_characterize(

@ -1,9 +1,13 @@
#ifndef BATTERY_H #ifndef BATTERY_H
#define BATTERY_H #define BATTERY_H
#include <stdint.h>
#include "esp_err.h"
namespace gay_ipod { namespace gay_ipod {
esp_error_t init_adc(void); esp_err_t init_adc(void);
/** /**
* Returns the current battery level in millivolts. * Returns the current battery level in millivolts.

@ -97,11 +97,11 @@ extern "C" void app_main(void)
ESP_ERROR_CHECK(expander.Write()); ESP_ERROR_CHECK(expander.Write());
ESP_LOGI(TAG, "Init ADC"); ESP_LOGI(TAG, "Init ADC");
ESP_ERROR_CHECK(init_adc()); ESP_ERROR_CHECK(gay_ipod::init_adc());
while (1) { while (1) {
uint32_t battery = read_battery_voltage(); uint32_t battery = gay_ipod::read_battery_voltage();
expander.Read(); expander.Read();
ESP_LOGI(TAG, "millivolts: %d, wall power? %d", battery, expander.charge_power_ok()); ESP_LOGI(TAG, "millivolts: %d, wall power? %d", battery, expander.charge_power_ok());

Loading…
Cancel
Save