Skip to content

Commit

Permalink
Merge pull request #56 from senseshift/feature/senseshift
Browse files Browse the repository at this point in the history
chore: rename code entries of openhaptics to senseshift
  • Loading branch information
leon0399 authored Apr 18, 2023
2 parents 7cec8b3 + 5c71f9d commit 8507692
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions firmware/firmware.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "openhaptics.h"
#include "senseshift.h"

#if defined(ARDUINO)
#include <Arduino.h>
Expand All @@ -19,7 +19,7 @@ extern void loopMode();

#if defined(ARDUINO)

OpenHaptics App;
SenseShift App;

void setup() {
setupMode();
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const size_t bhLayoutSize = BH_LAYOUT_TACTAL_SIZE;
static const oh_output_point_t* bhLayout[bhLayoutSize] = BH_LAYOUT_TACTAL;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactglove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <utility.hpp>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -19,8 +19,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

#pragma region bHaptics_trash

Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactosy2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const size_t bhLayoutSize = BH_LAYOUT_TACTOSY2_SIZE;
static const oh_output_point_t* bhLayout[bhLayoutSize] = BH_LAYOUT_TACTOSY2;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactosyf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const size_t bhLayoutSize = BH_LAYOUT_TACTOSYF_SIZE;
static const oh_output_point_t* bhLayout[bhLayoutSize] = BH_LAYOUT_TACTOSYF;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactosyh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const size_t bhLayoutSize = BH_LAYOUT_TACTOSYH_SIZE;
static const oh_output_point_t* bhLayout[bhLayoutSize] = BH_LAYOUT_TACTOSYH;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactsuit_x16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const oh_output_point_t* bhLayout[] = BH_LAYOUT_TACTSUITX16;
static const size_t bhLayoutSize = BH_LAYOUT_TACTSUITX16_SIZE;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactsuit_x16_pca9685.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -17,8 +17,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const oh_output_point_t* bhLayout[] = BH_LAYOUT_TACTSUITX16;
static const size_t bhLayoutSize = BH_LAYOUT_TACTSUITX16_SIZE;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/bhaptics/tactsuit_x40.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>
#include <Wire.h>

#include "openhaptics.h"
#include "senseshift.h"

#include <bh_utils.hpp>
#include <connection_bhble.hpp>
Expand All @@ -18,8 +18,8 @@
using namespace OH;
using namespace BH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

static const size_t bhLayoutSize = BH_LAYOUT_TACTSUITX40_SIZE;
static const oh_output_point_t* bhLayout[bhLayoutSize] = BH_LAYOUT_TACTSUITX40;
Expand Down
6 changes: 3 additions & 3 deletions firmware/mode_configs/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#include "Arduino.h"
#endif

#include "openhaptics.h"
#include "senseshift.h"

#include <haptic_body.hpp>

using namespace OH;

extern OpenHaptics App;
OpenHaptics* app = &App;
extern SenseShift App;
SenseShift* app = &App;

class TestOutput : public OH::AbstractActuator {
private:
Expand Down
8 changes: 4 additions & 4 deletions firmware/openhaptics.cpp → firmware/senseshift.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#include "config/all.h"

#include "openhaptics.h"
#include "senseshift.h"

#ifdef ARDUINO
#include <Arduino.h>
#endif

#include <logging.hpp>

OpenHaptics::OpenHaptics() {
SenseShift::SenseShift() {
this->pHapticBody = new OH::HapticBody();
}

void OpenHaptics::postEvent(const OH::IEvent* event) {
void SenseShift::postEvent(const OH::IEvent* event) {
log_i("Event dispatched at %u: %s (%p)", millis(), event->eventName.c_str(), event);

for (auto* listener : this->eventListeners) {
Expand All @@ -22,6 +22,6 @@ void OpenHaptics::postEvent(const OH::IEvent* event) {
delete event;
}

void OpenHaptics::addEventListener(const OH::IEventListener* listener) {
void SenseShift::addEventListener(const OH::IEventListener* listener) {
this->eventListeners.push_back(listener);
}
28 changes: 14 additions & 14 deletions include/config/bluetooth.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pragma once

#ifndef BLUETOOTH_NAME
#define BLUETOOTH_NAME "OpenHaptics"
#endif

#ifndef BLUETOOTH_ADDRESS
#define BLUETOOTH_ADDRESS \
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB }
#endif

#ifndef BLUETOOTH_USE_NIMBLE
#define BLUETOOTH_USE_NIMBLE false
#endif
#pragma once

#ifndef BLUETOOTH_NAME
#define BLUETOOTH_NAME "SenseShift"
#endif

#ifndef BLUETOOTH_ADDRESS
#define BLUETOOTH_ADDRESS \
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB }
#endif

#ifndef BLUETOOTH_USE_NIMBLE
#define BLUETOOTH_USE_NIMBLE false
#endif
4 changes: 2 additions & 2 deletions include/openhaptics.h → include/senseshift.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <vector>

class OpenHaptics final : public OH::IEventDispatcher
class SenseShift final : public OH::IEventDispatcher
{
private:
std::vector<const OH::IEventListener*> eventListeners{};
Expand All @@ -23,7 +23,7 @@ class OpenHaptics final : public OH::IEventDispatcher
#endif

public:
OpenHaptics();
SenseShift();

OH::HapticBody* getHapticBody() {
return this->pHapticBody;
Expand Down

1 comment on commit 8507692

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

18.16%

Please sign in to comment.