supla-device
Loading...
Searching...
No Matches
lck.h
1/*
2 Copyright (C) AC SOFTWARE SP. Z O.O.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef LCK_H_
20#define LCK_H_
21
22#if defined(ESP8266)
23#include <mem.h>
24#define LCK_ICACHE_FLASH ICACHE_FLASH_ATTR
25#endif
26
27#if defined(ARDUINO)
28#undef LCK_ICACHE_FLASH
29#endif /*defined(ARDUINO)*/
30
31#ifndef LCK_ICACHE_FLASH
32#define LCK_ICACHE_FLASH
33#endif /*LCK_ICACHE_FLASH*/
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39void LCK_ICACHE_FLASH lck_lock(void *lck);
40
41char LCK_ICACHE_FLASH lck_lock_with_timeout(void *lck, int timeout_sec);
42void LCK_ICACHE_FLASH lck_unlock(void *lck);
43int LCK_ICACHE_FLASH lck_unlock_r(void *lck, int result);
44void *LCK_ICACHE_FLASH lck_init(void);
45void LCK_ICACHE_FLASH lck_free(void *lck);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif /* LCK_H_ */