Skip to content

Commit

Permalink
Merge pull request #346 from aabadie/cleanup_emstudio8.18_build
Browse files Browse the repository at this point in the history
drv/upgate: projects: fix build warning with ses 8.18
  • Loading branch information
aabadie authored Nov 14, 2024
2 parents 916b54e + ca89869 commit ac7716d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions drv/upgate/upgate.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ void db_upgate_start(void) {
printf("Sectors to erase: %u\n", sector_count);
for (uint32_t sector = 0; sector < sector_count; sector++) {
uint32_t addr = _upgate_vars.addr + sector * N25Q128_SECTOR_SIZE;
printf("Erasing sector %u at %p\n", sector, addr);
printf("Erasing sector %u at %p\n", sector, (uint32_t *)addr);
n25q128_sector_erase(addr);
}
puts("");
uzlib_init();
_upgate_vars.last_packet_acked = UINT32_MAX;
printf("Starting upgate at %p\n\n", _upgate_vars.addr);
printf("Starting upgate at %p\n\n", (uint32_t *)_upgate_vars.addr);
}

void db_upgate_finish(void) {
Expand All @@ -101,12 +101,12 @@ void db_upgate_finish(void) {

for (uint32_t sector = 0; sector < sector_count; sector++) {
uint32_t addr = _upgate_vars.base_addr + sector * N25Q128_SECTOR_SIZE;
printf("Erasing sector %u at %p\n", sector, addr);
printf("Erasing sector %u at %p\n", sector, (uint32_t *)addr);
n25q128_sector_erase(addr);
}
// Copy and verify the content.
for (uint32_t block = 0; block < _upgate_vars.bistream_size / N25Q128_PAGE_SIZE; block++) {
printf("Moving %d bytes from %p to %p\n", N25Q128_PAGE_SIZE, _upgate_vars.addr + block * N25Q128_PAGE_SIZE, _upgate_vars.base_addr + block * N25Q128_PAGE_SIZE);
printf("Moving %d bytes from %p to %p\n", N25Q128_PAGE_SIZE, (uint32_t *)(_upgate_vars.addr + block * N25Q128_PAGE_SIZE), (uint32_t *)(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE));
n25q128_read(_upgate_vars.addr + block * N25Q128_PAGE_SIZE, _upgate_vars.temp_buffer, N25Q128_PAGE_SIZE);
n25q128_program_page(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE, _upgate_vars.temp_buffer, N25Q128_PAGE_SIZE);
n25q128_read(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE, _upgate_vars.read_buf, N25Q128_PAGE_SIZE);
Expand Down Expand Up @@ -168,7 +168,7 @@ void db_upgate_handle_packet(const db_upgate_pkt_t *pkt) {
_upgate_vars.compressed_length = 0;
uint32_t base_addr = _upgate_vars.addr + pkt->chunk_index * BUFFER_SIZE;
for (uint32_t block = 0; block < pkt->original_size / N25Q128_PAGE_SIZE; block++) {
printf("Programming %d bytes at %p\n", N25Q128_PAGE_SIZE, base_addr + block * N25Q128_PAGE_SIZE);
printf("Programming %d bytes at %p\n", N25Q128_PAGE_SIZE, (uint32_t *)(base_addr + block * N25Q128_PAGE_SIZE));
n25q128_program_page(base_addr + block * N25Q128_PAGE_SIZE, &_upgate_vars.decompressed_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE);
n25q128_read(base_addr + block * N25Q128_PAGE_SIZE, &_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE);
if (memcmp(&_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], &_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE) != 0) {
Expand All @@ -187,7 +187,7 @@ void db_upgate_handle_packet(const db_upgate_pkt_t *pkt) {
}
uint32_t addr = _upgate_vars.addr + (pkt->chunk_index - 1) * DB_UPGATE_CHUNK_SIZE;
size_t data_size = (pkt->chunk_index == chunk_count - 1 && chunk_count % 2 == 1) ? pkt->original_size : DB_UPGATE_CHUNK_SIZE + pkt->original_size;
printf("Programming %d bytes at %p\n", data_size, addr);
printf("Programming %d bytes at %p\n", data_size, (uint32_t *)addr);
n25q128_program_page(addr, _upgate_vars.write_buf, data_size);
n25q128_read(addr, _upgate_vars.read_buf, data_size);
if (memcmp(_upgate_vars.write_buf, _upgate_vars.read_buf, data_size) != 0) {
Expand Down
2 changes: 1 addition & 1 deletion projects/01bsp_nvmc/01bsp_nvmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(void) {
db_nvmc_write(address, message, strlen(message));
db_nvmc_read(buffer, address, strlen(message));

printf("Message written: %s\n", (char *)buffer, strlen(message));
printf("Message written: %s (len: %d)\n", (char *)buffer, strlen(message));

while (1) {
__NOP();
Expand Down
2 changes: 1 addition & 1 deletion projects/03app_log_dump/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(void) {
db_log_dotbot_data_t data;
db_nvmc_read(&data, _read_address, sizeof(db_log_dotbot_data_t));
printf(
"%lu;%i;%lu;%lu;%u;%lu;%i;%i;%i;%i;%i\n",
"%u;%i;%u;%u;%u;%u;%i;%i;%i;%i;%i\n",
timestamp, data.direction, data.pos_x, data.pos_y,
data.next_waypoint_idx, data.distance_to_target,
data.angle_to_target, data.error_angle, data.angular_speed,
Expand Down

0 comments on commit ac7716d

Please sign in to comment.