---
title: "Comment by Guilhem Pelissier on \"STM32F4 Embedded Rust at the HAL: The RTIC Framework\" | Hashnode"
description: "Hello! First off, thank you very much for this series of articles, it&#39;s very helpful and nicely written. I think I&#39;ve found a small bug in the button_pr"
url: "https://hashnode.com/posts/stm32f4-embedded-rust-at-the-hal-the-rtic-framework/63162776d54563f8b19b03ec/comment/6346972bde139d2720692164"
---

[Discussion](https://hashnode.com/posts/stm32f4-embedded-rust-at-the-hal-the-rtic-framework/63162776d54563f8b19b03ec)

Comment [STM32F4 Embedded Rust at the HAL: The RTIC Framework](https://hashnode.com/posts/stm32f4-embedded-rust-at-the-hal-the-rtic-framework/63162776d54563f8b19b03ec)

[Guilhem Pelissier](https://hashnode.com/@Seeveenn)

[Oct 12, 2022](https://hashnode.com/posts/stm32f4-embedded-rust-at-the-hal-the-rtic-framework/63162776d54563f8b19b03ec/comment/6346972bde139d2720692164)

Hello! First off, thank you very much for this series of articles, it's very helpful and nicely written.

I think I've found a small bug in the `button_pressed` task: it seems like the modification to the delay value is not saved in the local variable, and subsequent presses on the button don't decrease the value further (pressing the button always set the delay to 1500ms)

I've added the following line right after adjusting the delay value:

```
*ctx.local.delayval = delay;
```

and it seems like it fixes the problem.

Thank you once again for this series

[Omar Hiari](https://hashnode.com/@omarhiari)

[Oct 12, 2022](https://hashnode.com/posts/stm32f4-embedded-rust-at-the-hal-the-rtic-framework/63162776d54563f8b19b03ec/comment/6346972bde139d2720692164#reply-6346b22f81c6df26fb021d4f)

Thank you Guilhem! You are absolutely correct! I should have updated the `delayval` value in the global context after it gets modified in the task. Looks like I missed it when I tested it. I will adjust the post right away to reflect the correct code.
