Skip to content

Commit

Permalink
Trailing whitespace cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
flit committed Jan 15, 2020
1 parent 72f97fe commit 3bfd302
Show file tree
Hide file tree
Showing 30 changed files with 82 additions and 82 deletions.
4 changes: 2 additions & 2 deletions source/daplink/circ_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ uint8_t circ_buf_pop(circ_buf_t *circ_buf)
}

cortex_int_restore(state);

return data;
}

Expand All @@ -93,7 +93,7 @@ uint32_t circ_buf_count_used(circ_buf_t *circ_buf)
cortex_int_restore(state);
return cnt;
}

uint32_t circ_buf_count_free(circ_buf_t *circ_buf)
{
uint32_t cnt;
Expand Down
4 changes: 2 additions & 2 deletions source/daplink/drag-n-drop/flash_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t
case FLASH_DECODER_TYPE_INTERFACE:
end_addr = DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE;
break;

case FLASH_DECODER_TYPE_TARGET:
//only if we are sure it is a bin for the target; without check unordered hex files will cause to terminate flashing
if (flash_type_target_bin && g_board_info.target_cfg) {
Expand All @@ -366,7 +366,7 @@ static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t
if(end_addr == 0){ //invalid end_addr
return false;
}

}
else {
return false;
Expand Down
14 changes: 7 additions & 7 deletions source/daplink/drag-n-drop/flash_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ error_t flash_manager_init(const flash_intf_t *flash_intf)
return status;
}

if (!page_erase_enabled) {
if (!page_erase_enabled) {
// Erase flash and unint if there are errors
status = intf->erase_chip();
flash_manager_printf(" intf->erase_chip ret=%i\r\n", status);
Expand Down Expand Up @@ -132,16 +132,16 @@ error_t flash_manager_data(uint32_t addr, const uint8_t *data, uint32_t size)
current_sector_valid = true;
last_addr = addr;
}

//non-increasing address support
if (ROUND_DOWN(addr, current_write_block_size) != ROUND_DOWN(last_addr, current_write_block_size)) {
if (ROUND_DOWN(addr, current_write_block_size) != ROUND_DOWN(last_addr, current_write_block_size)) {
status = flush_current_block(addr);
if (ERROR_SUCCESS != status) {
state = STATE_ERROR;
return status;
}
}

if (ROUND_DOWN(addr, current_sector_size) != ROUND_DOWN(last_addr, current_sector_size)) {
status = setup_next_sector(addr);
if (ERROR_SUCCESS != status) {
Expand Down Expand Up @@ -269,7 +269,7 @@ static bool flash_intf_valid(const flash_intf_t *flash_intf)
if (0 == flash_intf->erase_sector_size) {
return false;
}

if (0 == flash_intf->flash_busy) {
return false;
}
Expand Down Expand Up @@ -325,15 +325,15 @@ static error_t setup_next_sector(uint32_t addr)
return status;
}
}

if (page_erase_enabled) {
// Erase the current sector
status = intf->erase_sector(current_sector_addr);
flash_manager_printf(" intf->erase_sector(addr=0x%x) ret=%i\r\n", current_sector_addr);
if (ERROR_SUCCESS != status) {
intf->uninit();
return status;
}
}
}

// Clear out buffer in case block size changed
Expand Down
4 changes: 2 additions & 2 deletions source/daplink/drag-n-drop/intelhex.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ hexfile_parse_status_t parse_hex_blob(const uint8_t *hex_blob, const uint32_t he
default:
if (low_nibble) {
line.buf[idx] |= ctoh((uint8_t)(*hex_blob)) & 0xf;
if (++idx >= (line.byte_count + 5)) { //all data in
if (++idx >= (line.byte_count + 5)) { //all data in
if (0 == validate_checksum(&line)) {
status = HEX_PARSE_CKSUM_FAIL;
goto hex_parser_exit;
Expand Down Expand Up @@ -201,7 +201,7 @@ hexfile_parse_status_t parse_hex_blob(const uint8_t *hex_blob, const uint32_t he
break;
}
}
}
}
}
} else {
if (idx < sizeof(hex_line_t)) {
Expand Down
2 changes: 1 addition & 1 deletion source/daplink/drag-n-drop/vfs_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static void transfer_reset_file_info()
file_transfer_state = default_transfer_state;
abort_remount();
}

}

// Update the tranfer state with new information
Expand Down
6 changes: 3 additions & 3 deletions source/daplink/drag-n-drop/virtual_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ void vfs_init(const vfs_filename_t drive_name, uint32_t disk_size)
}
if (total_sectors >= 0x10000) {
mbr.total_logical_sectors = 0;
mbr.big_sectors_on_drive = total_sectors;
mbr.big_sectors_on_drive = total_sectors;
} else {
mbr.total_logical_sectors = total_sectors;
mbr.big_sectors_on_drive = 0;
mbr.big_sectors_on_drive = 0;
}
// FAT table will likely be larger than needed, but this is allowed by the
// fat specification
Expand Down Expand Up @@ -612,7 +612,7 @@ static uint32_t read_dir(uint32_t sector_offset, uint8_t *data, uint32_t num_sec
util_assert(0);
return 0;
}

// Zero buffer data is VFS_SECTOR_SIZE max
memset(data, 0, VFS_SECTOR_SIZE);

Expand Down
34 changes: 17 additions & 17 deletions source/daplink/interface/target_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static program_target_t * get_flash_algo(uint32_t addr)
}
}
}

//could not find a flash algo for the region; use default
if (default_region) {
flash_start = default_region->start;
Expand Down Expand Up @@ -139,9 +139,9 @@ static error_t target_flash_set(uint32_t addr)
if (0 == swd_write_memory(new_flash_algo->algo_start, (uint8_t *)new_flash_algo->algo_blob, new_flash_algo->algo_size)) {
return ERROR_ALGO_DL;
}

current_flash_algo = new_flash_algo;

}
return ERROR_SUCCESS;
}
Expand All @@ -150,13 +150,13 @@ static error_t target_flash_init()
{
if (g_board_info.target_cfg) {
last_flash_func = FLASH_FUNC_NOP;

current_flash_algo = NULL;

if (0 == target_set_state(RESET_PROGRAM)) {
return ERROR_RESET;
}

//get default region
region_info_t * flash_region = g_board_info.target_cfg->flash_regions;
for (; flash_region->start != 0 || flash_region->end != 0; ++flash_region) {
Expand All @@ -171,7 +171,7 @@ static error_t target_flash_init()
} else {
return ERROR_FAILURE;
}

}

static error_t target_flash_uninit(void)
Expand All @@ -191,7 +191,7 @@ static error_t target_flash_uninit(void)
// Check to see if anything needs to be done after programming.
// This is usually a no-op for most targets.
target_set_state(POST_FLASH_RESET);

state = STATE_CLOSED;
swd_off();
return ERROR_SUCCESS;
Expand All @@ -205,11 +205,11 @@ static error_t target_flash_program_page(uint32_t addr, const uint8_t *buf, uint
if (g_board_info.target_cfg) {
error_t status = ERROR_SUCCESS;
program_target_t * flash = current_flash_algo;

if (!flash) {
return ERROR_INTERNAL;
}

// check if security bits were set
if (g_target_family && g_target_family->security_bits_set){
if (1 == g_target_family->security_bits_set(addr, (uint8_t *)buf, size)) {
Expand All @@ -222,7 +222,7 @@ static error_t target_flash_program_page(uint32_t addr, const uint8_t *buf, uint
if (status != ERROR_SUCCESS) {
return status;
}

while (size > 0) {
uint32_t write_size = MIN(size, flash->program_buffer_size);

Expand Down Expand Up @@ -277,11 +277,11 @@ static error_t target_flash_program_page(uint32_t addr, const uint8_t *buf, uint
addr += write_size;
buf += write_size;
size -= write_size;

}

return ERROR_SUCCESS;

} else {
return ERROR_FAILURE;
}
Expand All @@ -296,7 +296,7 @@ static error_t target_flash_erase_sector(uint32_t addr)
if (!flash) {
return ERROR_INTERNAL;
}

// Check to make sure the address is on a sector boundary
if ((addr % target_flash_erase_sector_size(addr)) != 0) {
return ERROR_ERASE_SECTOR;
Expand All @@ -307,7 +307,7 @@ static error_t target_flash_erase_sector(uint32_t addr)
if (status != ERROR_SUCCESS) {
return status;
}

if (0 == swd_flash_syscall_exec(&flash->sys_call_s, flash->erase_sector, addr, 0, 0, 0)) {
return ERROR_ERASE_SECTOR;
}
Expand All @@ -325,7 +325,7 @@ static error_t target_flash_erase_chip(void)
region_info_t * flash_region = g_board_info.target_cfg->flash_regions;

for (; flash_region->start != 0 || flash_region->end != 0; ++flash_region) {
status = target_flash_set(flash_region->start);
status = target_flash_set(flash_region->start);
if (status != ERROR_SUCCESS) {
return status;
}
Expand Down Expand Up @@ -365,7 +365,7 @@ static uint32_t target_flash_program_page_min_size(uint32_t addr)
static uint32_t target_flash_erase_sector_size(uint32_t addr)
{
if (g_board_info.target_cfg){
if(g_board_info.target_cfg->sector_info_length > 0) {
if(g_board_info.target_cfg->sector_info_length > 0) {
int sector_index = g_board_info.target_cfg->sector_info_length - 1;
for (; sector_index >= 0; sector_index--) {
if (addr >= g_board_info.target_cfg->sectors_info[sector_index].start) {
Expand Down
8 changes: 4 additions & 4 deletions source/daplink/settings/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ typedef struct __attribute__((__packed__)) cfg_ram {
char assert_file_name[64 + 1];
uint16_t assert_line;
uint8_t assert_source;

// Additional debug information on faults
uint8_t valid_dumps;
uint32_t hexdump[ALLOWED_HEXDUMP]; //Alignments checked

// Disable msd support
uint8_t disable_msd;

//Add new entries from here

} cfg_ram_t;
Expand Down Expand Up @@ -214,7 +214,7 @@ uint8_t config_ram_get_hexdumps(uint32_t **hexdumps)
if (config_ram.valid_dumps == 0) {
return 0;
}

//prevent memcopy check alignment
*hexdumps = config_ram.hexdump;
return config_ram.valid_dumps;
Expand Down
8 changes: 4 additions & 4 deletions source/daplink/usb2uart/usbd_user_cdc_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ static U32 start_break_time = 0;
int32_t USBD_CDC_ACM_SendBreak(uint16_t dur)
{
uint32_t end_break_time;
#ifdef DRAG_N_DROP_SUPPORT
if (!flash_intf_target->flash_busy())
#endif
#ifdef DRAG_N_DROP_SUPPORT
if (!flash_intf_target->flash_busy())
#endif
{ //added checking if flashing on target is in progress
// reset and send the unique id over CDC
if (dur != 0) {
Expand Down Expand Up @@ -187,7 +187,7 @@ void cdc_process_event()
main_blink_cdc_led(MAIN_LED_FLASH);
}
}

// Always process events
main_cdc_send_event();
}
4 changes: 2 additions & 2 deletions source/daplink/validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uint8_t validate_bin_nvic(const uint8_t *buf)
{
if (g_target_family && g_target_family->validate_bin_nvic) {
return g_target_family && g_target_family->validate_bin_nvic(buf);
} else if (g_board_info.target_cfg) {
} else if (g_board_info.target_cfg) {
uint32_t i = 4, nvic_val = 0;
uint8_t in_range = 0;
// test the initial SP value
Expand All @@ -47,7 +47,7 @@ uint8_t validate_bin_nvic(const uint8_t *buf)
break;
}
}

if (in_range == 0) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion source/hic_hal/FlashOS.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file FlashOS.h
* @brief
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Expand Down
2 changes: 1 addition & 1 deletion source/hic_hal/FlashPrg.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file FlashPrg.h
* @brief
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Expand Down
4 changes: 2 additions & 2 deletions source/hic_hal/atmel/sam3u2c/uart.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file uart.c
* @brief
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Expand Down Expand Up @@ -182,7 +182,7 @@ static int get_tx_ready()
{
if (!_FlowControlEnabled) {
return 1;
}
}
return ((PIOA->PIO_PDSR >> BIT_CDC_USB2UART_CTS) & 1) == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion source/hic_hal/flash_blob.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file flash_blob.h
* @brief
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Expand Down
2 changes: 1 addition & 1 deletion source/hic_hal/freescale/k20dx/usb_config.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file usb_config.h
* @brief
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
Expand Down
2 changes: 1 addition & 1 deletion source/hic_hal/freescale/k26f/usb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
#define USBD_MAX_PACKET_CALC1 ((USBD_ADC_MAX_PACKET > USBD_CDC_ACM_MAX_PACKET ) ? (USBD_ADC_MAX_PACKET ) : (USBD_CDC_ACM_MAX_PACKET ))
#define USBD_MAX_PACKET_CALC2 ((USBD_MAX_PACKET_CALC0 > USBD_MAX_PACKET_CALC1 ) ? (USBD_MAX_PACKET_CALC0) : (USBD_MAX_PACKET_CALC1 ))
#define USBD_MAX_PACKET_CALC3 ((USBD_BULK_MAX_PACKET > USBD_CDC_ACM_MAX_PACKET1 ) ? (USBD_BULK_MAX_PACKET) : (USBD_CDC_ACM_MAX_PACKET1 ))
#define USBD_MAX_PACKET ((USBD_MAX_PACKET_CALC3 > USBD_MAX_PACKET_CALC2 ) ? (USBD_MAX_PACKET_CALC3) : (USBD_MAX_PACKET_CALC2 ))
#define USBD_MAX_PACKET ((USBD_MAX_PACKET_CALC3 > USBD_MAX_PACKET_CALC2 ) ? (USBD_MAX_PACKET_CALC3) : (USBD_MAX_PACKET_CALC2 ))


/*------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 3bfd302

Please sign in to comment.