add a .clang-format file (#9154)

This commit is contained in:
Jorropo
2026-01-03 21:19:24 +01:00
committed by GitHub
parent abab6ce815
commit 0d11331d18
771 changed files with 77752 additions and 83184 deletions

View File

@@ -9,15 +9,14 @@
#include <NonBlockingRtttl.h>
#else
// Noop class for portduino.
class rtttl
{
public:
explicit rtttl() {}
static bool isPlaying() { return false; }
static void play() {}
static void begin(byte a, const char *b){};
static void stop() {}
static bool done() { return true; }
class rtttl {
public:
explicit rtttl() {}
static bool isPlaying() { return false; }
static void play() {}
static void begin(byte a, const char *b){};
static void stop() {}
static bool done() { return true; }
};
#endif
#include <Arduino.h>
@@ -27,51 +26,49 @@ class rtttl
* Radio interface for ExternalNotificationModule
*
*/
class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread
{
CallbackObserver<ExternalNotificationModule, const InputEvent *> inputObserver =
CallbackObserver<ExternalNotificationModule, const InputEvent *>(this, &ExternalNotificationModule::handleInputEvent);
uint32_t output = 0;
class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread {
CallbackObserver<ExternalNotificationModule, const InputEvent *> inputObserver =
CallbackObserver<ExternalNotificationModule, const InputEvent *>(this, &ExternalNotificationModule::handleInputEvent);
uint32_t output = 0;
public:
ExternalNotificationModule();
public:
ExternalNotificationModule();
int handleInputEvent(const InputEvent *arg);
int handleInputEvent(const InputEvent *arg);
uint32_t nagCycleCutoff = 1;
uint32_t nagCycleCutoff = 1;
void setExternalState(uint8_t index = 0, bool on = false);
bool getExternal(uint8_t index = 0);
void setExternalState(uint8_t index = 0, bool on = false);
bool getExternal(uint8_t index = 0);
void setMute(bool mute) { isSilenced = mute; }
bool getMute() { return isSilenced; }
void setMute(bool mute) { isSilenced = mute; }
bool getMute() { return isSilenced; }
bool canBuzz();
bool nagging();
bool canBuzz();
bool nagging();
void stopNow();
void stopNow();
void handleGetRingtone(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response);
void handleSetRingtone(const char *from_msg);
void handleGetRingtone(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response);
void handleSetRingtone(const char *from_msg);
protected:
/** Called to handle a particular incoming message
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered for
it
*/
virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override;
protected:
/** Called to handle a particular incoming message
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be
considered for it
*/
virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override;
virtual int32_t runOnce() override;
virtual int32_t runOnce() override;
virtual bool wantPacket(const meshtastic_MeshPacket *p) override;
virtual bool wantPacket(const meshtastic_MeshPacket *p) override;
bool isNagging = false;
bool isNagging = false;
bool isSilenced = false;
bool isSilenced = false;
virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp,
meshtastic_AdminMessage *request,
meshtastic_AdminMessage *response) override;
virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *request,
meshtastic_AdminMessage *response) override;
};
extern ExternalNotificationModule *externalNotificationModule;