Skip to content

Commit 79ae930

Browse files
committed
fix some warnings with Wextra
1 parent 0516c2e commit 79ae930

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ CFLAGS += \
228228
-fstack-usage \
229229
-fno-strict-aliasing \
230230
-Wall \
231-
-Werror
231+
-Werror \
232+
-Wfatal-errors \
232233

233234
CFLAGS += -Wno-error=unused-parameter
234235

lib/sdk11/components/libraries/bootloader_dfu/bootloader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ uint32_t bootloader_dfu_sd_update_continue(void)
442442

443443
uint32_t bootloader_dfu_sd_update_finalize(void)
444444
{
445-
dfu_update_status_t update_status = {DFU_UPDATE_SD_SWAPPED, };
445+
dfu_update_status_t update_status = { 0 };
446+
update_status.status_code = DFU_UPDATE_SD_SWAPPED;
446447

447448
bootloader_dfu_update_process(update_status);
448449

lib/sdk11/components/libraries/bootloader_dfu/dfu_single_bank.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ static void dfu_prepare_func_app_erase(uint32_t image_size)
164164
*/
165165
static void dfu_cleared_func_app(void)
166166
{
167-
dfu_update_status_t update_status = {DFU_BANK_0_ERASED, };
167+
dfu_update_status_t update_status = { 0 };
168+
update_status.status_code = DFU_BANK_0_ERASED;
168169
bootloader_dfu_update_process(update_status);
169170
}
170171

@@ -498,7 +499,8 @@ uint32_t dfu_init_pkt_handle(dfu_update_packet_t * p_packet)
498499
{
499500
case DFU_STATE_RDY:
500501
m_dfu_state = DFU_STATE_RX_INIT_PKT;
501-
// When receiving init packet in state ready just update and fall through this case.
502+
// When receiving init packet in state ready just update and fall through this case.
503+
/* FALLTHRU */
502504

503505
case DFU_STATE_RX_INIT_PKT:
504506
// DFU initialization has been done and a start packet has been received.

tools/build_all.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,18 @@
3737
make_result = subprocess.run("make -j 4 BOARD={} combinehex genpkg".format(board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
3838
build_duration = time.monotonic() - start_time
3939

40+
flash_size = "-"
41+
sram_size = "-"
42+
4043
if make_result.returncode == 0:
4144
success = "\033[32msucceeded\033[0m"
4245
success_count += 1
46+
47+
out_file = glob.glob('_build/build-{}/*.out'.format(board))[0]
48+
size_output = subprocess.run('size {}'.format(out_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
49+
size_list = size_output.split('\n')[1].split('\t')
50+
flash_size = int(size_list[0])
51+
sram_size = int(size_list[1]) + int(size_list[2])
4352
else:
4453
exit_status = make_result.returncode
4554
success = "\033[31mfailed\033[0m "
@@ -50,12 +59,6 @@
5059
if entry.name.endswith(extension) and "nosd" not in entry.name:
5160
shutil.copy(entry.path, bin_directory)
5261

53-
out_file = glob.glob('_build/build-{}/*.out'.format(board))[0]
54-
size_output = subprocess.run('size {}'.format(out_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
55-
size_list = size_output.split('\n')[1].split('\t')
56-
flash_size = int(size_list[0])
57-
sram_size = int(size_list[1]) + int(size_list[2])
58-
5962
print(build_format.format(board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
6063

6164
if make_result.returncode != 0:

0 commit comments

Comments
 (0)