Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1620_improved TextLCD_improved mbed-rtos mbed
tsk_button.cpp
- Committer:
- dzoni
- Date:
- 2015-12-18
- Revision:
- 17:94c385ff2641
- Parent:
- 11:e89f89c0920b
- Child:
- 18:be0130c42925
File content as of revision 17:94c385ff2641:
#include "mbed.h"
#include "rtos.h"
#include "tsk_button.h"
#include "tsk_led.h"
static DigitalIn button1(USER_BUTTON);
void button_thread(void const *args) {
static uint32_t last_state = button1;
uint32_t temp;
while (true) {
if (button1 != last_state) {
temp = led_flash_times.on_time;
led_flash_times.on_time = led_flash_times.off_time;
led_flash_times.off_time = temp;
}
Thread::wait(500);
}
}