mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-05-31 21:43:19 +00:00
Swap info.json.gz length to #define.
This commit is contained in:
parent
81a53ac5b6
commit
ffcdfc6c03
@ -240,7 +240,7 @@
|
|||||||
define: INFO_LEN_QUERY
|
define: INFO_LEN_QUERY
|
||||||
description: Retrieves the length of info.json
|
description: Retrieves the length of info.json
|
||||||
return_type: u32
|
return_type: u32
|
||||||
return_constant: info_json_gz_len
|
return_constant: INFO_JSON_GZ_LEN
|
||||||
}
|
}
|
||||||
0x06: {
|
0x06: {
|
||||||
type: command
|
type: command
|
||||||
|
@ -36,6 +36,6 @@ def generate_info(output_file, keyboard, keymap):
|
|||||||
lines.append('static const unsigned char info_json_gz[] PROGMEM = {')
|
lines.append('static const unsigned char info_json_gz[] PROGMEM = {')
|
||||||
lines.append(data)
|
lines.append(data)
|
||||||
lines.append('};')
|
lines.append('};')
|
||||||
lines.append(f'static const unsigned int info_json_gz_len = {data_len};')
|
lines.append(f'#define INFO_JSON_GZ_LEN {data_len}')
|
||||||
|
|
||||||
dump_lines(output_file, lines)
|
dump_lines(output_file, lines)
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
#include "info_json_gz.h"
|
#include "info_json_gz.h"
|
||||||
bool get_info_json_chunk(uint16_t offset, uint8_t *data, uint8_t data_len) {
|
bool get_info_json_chunk(uint16_t offset, uint8_t *data, uint8_t data_len) {
|
||||||
if (offset + data_len > info_json_gz_len) {
|
if (offset + data_len > INFO_JSON_GZ_LEN) {
|
||||||
data_len = info_json_gz_len - offset;
|
data_len = INFO_JSON_GZ_LEN - offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy_P(data, &info_json_gz[offset], data_len);
|
memcpy_P(data, &info_json_gz[offset], data_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user