Replace confini with toml
This commit is contained in:
parent
25eab5d38e
commit
79b1f3b2cf
27 changed files with 3081 additions and 5926 deletions
src/handlers
|
@ -53,9 +53,9 @@ handler_command_relay_pulse(mpack_node_t map)
|
|||
{
|
||||
uint8_t relay_num = mpack_node_u8(mpack_node_map_uint(map, COMMAND_MAPPING_RELAY_NUM));
|
||||
|
||||
if(relay_num > global_config.relay_count)
|
||||
if(relay_num > global_config->relay_count)
|
||||
{
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config.relay_count);
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config->relay_count);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ handler_command_relay_pulse(mpack_node_t map)
|
|||
int duration = mpack_node_u8(mpack_node_map_uint(map, COMMAND_MAPPING_PULSE_DURATION));
|
||||
if(duration == 0)
|
||||
{
|
||||
duration = global_config.relay_configs[relay_num].pulse_duration;
|
||||
duration = global_config->relay_configs[relay_num].pulse_duration;
|
||||
}
|
||||
target_relay->pulse_timer = duration;
|
||||
LOGGER_DEBUG("pulsing relay %d for %ds\n", relay_num, duration);
|
||||
|
@ -87,9 +87,9 @@ handler_command_relay_name_set(mpack_node_t map)
|
|||
uint8_t relay_num = mpack_node_u8(mpack_node_map_uint(map, COMMAND_MAPPING_RELAY_NUM));
|
||||
const char *relay_name = mpack_node_str(mpack_node_map_uint(map, COMMAND_MAPPING_NAME));
|
||||
|
||||
if(relay_num > global_config.relay_count)
|
||||
if(relay_num > global_config->relay_count)
|
||||
{
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config.relay_count);
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config->relay_count);
|
||||
return;
|
||||
}
|
||||
relay_set_name(global_controller->relays[relay_num], relay_name);
|
||||
|
@ -120,7 +120,7 @@ handler_command_schedule_update(mpack_node_t map)
|
|||
|
||||
int *relay_ids = junction_relay_schedule_get_relay_ids_with_schedule(new_schedule->id);
|
||||
|
||||
for(int i = 0; i < global_config.relay_count; ++i)
|
||||
for(int i = 0; i < global_config->relay_count; ++i)
|
||||
{
|
||||
for(int j = 0; relay_ids[j] != 0; ++j)
|
||||
{
|
||||
|
@ -140,9 +140,9 @@ handler_command_relay_schedules_set(mpack_node_t map)
|
|||
{
|
||||
uint8_t relay_num = mpack_node_u8(mpack_node_map_uint(map, COMMAND_MAPPING_RELAY_NUM));
|
||||
|
||||
if(relay_num > global_config.relay_count)
|
||||
if(relay_num > global_config->relay_count)
|
||||
{
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config.relay_count);
|
||||
LOGGER_WARNING("relay %d is not available (relay count: %d\n", relay_num, global_config->relay_count);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue