|
| 1 | +/********************************************************************************************** |
| 2 | + Copyright (C) 2022 Oliver Eichler <oliver.eichler@gmx.de> |
| 3 | +
|
| 4 | + This program is free software: you can redistribute it and/or modify |
| 5 | + it under the terms of the GNU General Public License as published by |
| 6 | + the Free Software Foundation, either version 3 of the License, or |
| 7 | + (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, see <http://www.gnu.org/licenses/>. |
| 16 | +
|
| 17 | +**********************************************************************************************/ |
1 | 18 | #include "controller.hpp" |
2 | 19 |
|
3 | 20 | #include <fmt/format.h> |
|
13 | 30 | constexpr const char* kConfigFile = "config.json"; |
14 | 31 | constexpr const char* kConfigPath = "/home/pi/.config/led_control/"; |
15 | 32 |
|
| 33 | +#ifndef _MKSTR_1 |
| 34 | +#define _MKSTR_1(x) #x |
| 35 | +#define _MKSTR(x) _MKSTR_1(x) |
| 36 | +#endif |
| 37 | + |
| 38 | +#define VER_STR _MKSTR(VER_MAJOR) "." _MKSTR (VER_MINOR) "." _MKSTR (VER_STEP) |
| 39 | +#define WHAT_STR _MKSTR(APPLICATION_NAME) ", Version " VER_STR |
| 40 | + |
| 41 | + |
16 | 42 | Controller::Controller() : Log("ctrl") |
17 | 43 | { |
| 44 | + I(fmt::format("-------------- {} --------------", WHAT_STR)); |
| 45 | + |
18 | 46 | memset(&ledstring, 0, sizeof (ledstring)); |
19 | 47 | ledstring.freq = TARGET_FREQ; |
20 | 48 | ledstring.dmanum = DMA; |
21 | 49 | ledstring.channel[0].gpionum = GPIO_PIN; |
22 | 50 | ledstring.channel[0].count = LED_COUNT; |
23 | 51 | ledstring.channel[0].invert = 0; |
24 | | - ledstring.channel[0].brightness = 255; |
| 52 | + ledstring.channel[0].brightness = 100; |
25 | 53 | ledstring.channel[0].strip_type = STRIP_TYPE; |
26 | 54 |
|
27 | 55 | const std::filesystem::path path{kConfigPath}; |
|
0 commit comments