Skip to content

Commit ed07ab3

Browse files
Merge branch 'main' into dev-container-nightly
2 parents 60d69f1 + 8e8dde5 commit ed07ab3

File tree

13 files changed

+95
-42
lines changed

13 files changed

+95
-42
lines changed

.github/workflows/devcontainer-all.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

.github/workflows/devcontainer-azurertos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

.github/workflows/devcontainer-chibios.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

.github/workflows/devcontainer-esp32.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

.github/workflows/devcontainer-freertos-nxp.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

.github/workflows/devcontainer-smoketest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
contents: read
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v5
4040
with:
4141
submodules: true
4242

.github/workflows/devcontainer-ti.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727

2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Free Disk Space (Ubuntu)
3232
uses: jlumbroso/free-disk-space@main
@@ -55,7 +55,7 @@ jobs:
5555
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}
5656

5757
- name: Build and Push Docker Image
58-
uses: docker/build-push-action@v5
58+
uses: docker/build-push-action@v6
5959
with:
6060
file: ${{ env.CONTAINER_SRC_FILE }}
6161
push: true # Will only build if this is not here

targets/AzureRTOS/Maxim/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ struct gpio_input_state : public HAL_DblLinkedNode<gpio_input_state>
3838
void *param;
3939
// Expected state for debounce handler
4040
GPIO_PinState expected;
41+
// Current pin state
42+
GPIO_PinState current;
4143
// True if waiting for debounce timer to complete
4244
bool waitingDebounce;
4345
};
@@ -76,14 +78,15 @@ static void DebounceTimerCallback(uint32_t id)
7678
// get current pin state
7779
bool actual = HAL_GPIO_ReadPin(port, GPIO_PIN(pState->pinNumber));
7880

79-
if (actual == pState->expected)
81+
if (actual == pState->current)
8082
{
8183
pState->isrPtr(pState->pinNumber, actual, pState->param);
84+
8285
if (pState->mode == GPIO_INT_EDGE_BOTH)
8386
{
8487
// both edges
85-
// update expected state
86-
pState->expected = (GPIO_PinState)(pState->expected ^ GPIO_PIN_SET);
88+
// update current state
89+
pState->current = (GPIO_PinState)(pState->current ^ GPIO_PIN_SET);
8790
}
8891
}
8992

@@ -123,10 +126,14 @@ void HAL_GPIO_EXTI_Callback(uint16_t gpioPin)
123126
{
124127
TX_RESTORE
125128

126-
pGpio->isrPtr(
127-
pGpio->pinNumber,
128-
HAL_GPIO_ReadPin(GPIO_PORT(pGpio->pinNumber), GPIO_PIN(pGpio->pinNumber)),
129-
pGpio->param);
129+
bool level = HAL_GPIO_ReadPin(GPIO_PORT(pGpio->pinNumber), GPIO_PIN(pGpio->pinNumber));
130+
131+
if (level != pGpio->current)
132+
{
133+
pGpio->current = level;
134+
135+
pGpio->isrPtr(pGpio->pinNumber, level, pGpio->param);
136+
}
130137

131138
TX_DISABLE
132139
}
@@ -167,6 +174,7 @@ gpio_input_state *AllocateGpioInputState(GPIO_PIN pinNumber)
167174
{
168175
memset(ptr, 0, sizeof(gpio_input_state));
169176
ptr->pinNumber = pinNumber;
177+
ptr->current = HAL_GPIO_ReadPin(GPIO_PORT(pGpio->pinNumber), GPIO_PIN(pGpio->pinNumber));
170178

171179
tx_timer_create(
172180
&ptr->debounceTimer,
@@ -490,7 +498,7 @@ void CPU_GPIO_DisablePin(GPIO_PIN pinNumber, GpioPinDriveMode driveMode, uint32_
490498

491499
GPIO_TypeDef *port = GPIO_PORT(pinNumber);
492500
uint32_t pin = GPIO_PIN(pinNumber);
493-
501+
494502
GPIO_InitTypeDef gpio_init_structure;
495503
gpio_init_structure.Pin = pin;
496504

targets/AzureRTOS/ST/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ static void DebounceTimerCallback(ULONG pinState)
7979
{
8080
// call ISR
8181
pState->isrPtr(pState->pinNumber, actual, pState->param);
82+
83+
if (pState->mode == GPIO_INT_EDGE_BOTH)
84+
{
85+
// update expected state
86+
pState->expected ^= 1;
87+
}
8288
}
8389

8490
// reset flag

targets/ChibiOS/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct gpio_input_state : public HAL_DblLinkedNode<gpio_input_state>
2323
uint8_t mode; // Interrupt mode
2424
void *param; // Param to user isr call
2525
bool expected; // Expected state for debounce handler
26+
bool current; // Current pin state
2627
bool waitingDebounce; // True if waiting for debounce timer to complete
2728
};
2829

@@ -53,10 +54,11 @@ static void DebounceTimerCallback(virtual_timer_t *vtp, void *arg)
5354
if (actual == pState->expected)
5455
{
5556
pState->isrPtr(pState->pinNumber, actual, pState->param);
57+
5658
if (pState->mode == GPIO_INT_EDGE_BOTH)
5759
{
58-
// both edges
59-
pState->expected ^= 1; // update expected state
60+
// update expected state
61+
pState->expected ^= 1;
6062
}
6163
}
6264

@@ -92,9 +94,14 @@ static void GpioEventCallback(void *arg)
9294
// get IoLine from pin number
9395
ioline_t ioLine = GetIoLine(pGpio->pinNumber);
9496

95-
chSysUnlockFromISR();
96-
pGpio->isrPtr(pGpio->pinNumber, palReadLine(ioLine), pGpio->param);
97-
chSysLockFromISR();
97+
bool level = palReadLine(ioLine);
98+
99+
if (level != pGpio->current)
100+
{
101+
pGpio->current = level;
102+
103+
pGpio->isrPtr(pGpio->pinNumber, level, pGpio->param);
104+
}
98105
}
99106

100107
chSysUnlockFromISR();
@@ -131,6 +138,7 @@ gpio_input_state *AllocateGpioInputState(GPIO_PIN pinNumber)
131138
{
132139
memset(ptr, 0, sizeof(gpio_input_state));
133140
ptr->pinNumber = pinNumber;
141+
ptr->current = palReadLine(GetIoLine(pinNumber));
134142

135143
chVTObjectInit(&ptr->debounceTimer);
136144

0 commit comments

Comments
 (0)