2022-12-02 22:48:00 +00:00
|
|
|
// Copyright 2022 QMK
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include "quantum.h"
|
|
|
|
#include "xap.h"
|
|
|
|
|
|
|
|
#if ((defined(AUDIO_ENABLE)))
|
|
|
|
# include "audio.h"
|
|
|
|
|
|
|
|
extern audio_config_t audio_config;
|
|
|
|
|
2023-03-26 22:51:27 +00:00
|
|
|
bool xap_execute_get_audio_config(xap_token_t token) {
|
2022-12-02 22:48:00 +00:00
|
|
|
xap_route_audio_get_config_t ret;
|
|
|
|
|
|
|
|
ret.enable = audio_config.enable;
|
|
|
|
ret.clicky_enable = audio_config.clicky_enable;
|
|
|
|
|
|
|
|
return xap_respond_data(token, &ret, sizeof(ret));
|
|
|
|
}
|
|
|
|
|
2023-03-26 22:51:27 +00:00
|
|
|
bool xap_execute_set_audio_config(xap_token_t token, xap_route_audio_set_config_arg_t* arg) {
|
2022-12-02 22:48:00 +00:00
|
|
|
audio_config.enable = arg->enable;
|
|
|
|
audio_config.clicky_enable = arg->clicky_enable;
|
|
|
|
|
|
|
|
return xap_respond_success(token);
|
|
|
|
}
|
|
|
|
|
2023-03-26 22:51:27 +00:00
|
|
|
bool xap_execute_save_audio_config(xap_token_t token) {
|
2023-03-23 00:46:25 +00:00
|
|
|
eeconfig_update_audio_current();
|
2022-12-02 22:48:00 +00:00
|
|
|
|
|
|
|
return xap_respond_success(token);
|
|
|
|
}
|
|
|
|
#endif
|