Skip to content

Commit 5285bcc

Browse files
committed
Rename variable '__this' to 'pThis'
1 parent b3bbeeb commit 5285bcc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cores/arduino/HardwareTimer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ HardwareTimer::HardwareTimer(TIM_TypeDef *instance)
6565
_HardwareTimerObj.handle.State = HAL_TIM_STATE_RESET;
6666

6767
_HardwareTimerObj.handle.Instance = instance;
68-
_HardwareTimerObj.__this = (void *)this;
68+
_HardwareTimerObj.pThis = (void *)this;
6969

7070
// Enable Timer clock
7171
enableTimerClock(&(_HardwareTimerObj.handle));
@@ -707,7 +707,7 @@ void HardwareTimer::updateCallback(TIM_HandleTypeDef *htim)
707707
}
708708

709709
HardwareTimerObj_t *obj = get_timer_obj(htim);
710-
HardwareTimer *HT = (HardwareTimer *)(obj->__this);
710+
HardwareTimer *HT = (HardwareTimer *)(obj->pThis);
711711

712712
if (HT->callbacks[0] != NULL) {
713713
HT->callbacks[0](HT);
@@ -749,7 +749,7 @@ void HardwareTimer::captureCompareCallback(TIM_HandleTypeDef *htim)
749749
}
750750

751751
HardwareTimerObj_t *obj = get_timer_obj(htim);
752-
HardwareTimer *HT = (HardwareTimer *)(obj->__this);
752+
HardwareTimer *HT = (HardwareTimer *)(obj->pThis);
753753

754754
if (HT->callbacks[channel] != NULL) {
755755
HT->callbacks[channel](HT);
@@ -764,7 +764,7 @@ HardwareTimer::~HardwareTimer()
764764
{
765765
uint32_t index = get_timer_index(_HardwareTimerObj.handle.Instance);
766766
HardwareTimer_Handle[index] = NULL;
767-
_HardwareTimerObj.__this = NULL;
767+
_HardwareTimerObj.pThis = NULL;
768768
enableTimerClock(&(_HardwareTimerObj.handle));
769769
}
770770

cores/arduino/HardwareTimer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ typedef enum {
7777
// This structure is used to be able to get HardwareTimer instance (C++ class)
7878
// from handler (C structure) specially for interrupt management
7979
typedef struct {
80-
void *__this; // Those 2 first field must remain in this order at the beginning of the structure
81-
TIM_HandleTypeDef handle; // Those 2 first field must remain in this order at the beginning of the structure
82-
// void (*callbacks[1 + TIMER_CHANNELS])(HardwareTimer*); //Callbacks: 0 for update, 1-4 for channels. (channel5/channel6, if any, doesn't have interrupt)
80+
// Those 2 first fields must remain in this order at the beginning of the structure
81+
void *pThis;
82+
TIM_HandleTypeDef handle;
8383
} HardwareTimerObj_t;
8484

8585
#ifdef __cplusplus

0 commit comments

Comments
 (0)