Skip to content

Commit

Permalink
Add: インクルードガードを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yushin-ito committed Dec 4, 2023
1 parent 0543085 commit a4e5382
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 37 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "M5Battery",
"version": "0.0.3",
"version": "0.0.5",
"description": "An M5Stack library for displaying battery charge.",
"keywords": "esp32, m5stack, m5stickc, m5stickc-plus",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/M5Battery.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "M5Battery.h"

TaskHandle_t drawTaskHandle;
static TaskHandle_t drawTaskHandle;

Context::Context(M5Battery* bat) {
_bat = bat;
Expand All @@ -10,7 +10,7 @@ M5Battery* Context::getBattery() {
return _bat;
}

void drawLoop(void* args) {
static void drawLoop(void* args) {
Context* ctx = reinterpret_cast<Context*>(args);
M5Battery* bat = ctx->getBattery();

Expand Down
12 changes: 10 additions & 2 deletions src/M5Battery.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef M5Battery_H
#define M5Battery_H
#include <M5Unified.h>

class M5Battery {
Expand All @@ -21,7 +23,7 @@ class M5Battery {

public:
M5Battery();
void setPosition(int32_t x, int32_t y);
void setPosition(int32_t x, int32_t y);
void setRotation(uint8_t rotation);
void setSize(size_t size);
void setBgColor(uint32_t color);
Expand All @@ -38,11 +40,17 @@ class M5Battery {
bool isCharging();
};

#endif // M5Battery_H

#ifndef CONTEXT_H
#define CONTEXT_H

class Context {
private:
M5Battery* _bat;

public:
Context(M5Battery* bat);
M5Battery* getBattery();
};
};
#endif // CONTEXT_H
32 changes: 0 additions & 32 deletions src/main.cpp

This file was deleted.

0 comments on commit a4e5382

Please sign in to comment.