Skip to content

Commit

Permalink
Merge pull request #70 from YuzukiHD/dev
Browse files Browse the repository at this point in the history
[log] using marco to reduce size
  • Loading branch information
YuzukiTsuru authored Apr 17, 2024
2 parents a140fc8 + 618dc3a commit 4155430
Show file tree
Hide file tree
Showing 166 changed files with 2,155 additions and 2,097 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ else ()
endif ()

# Define the project name and languages used
project(SyterKit VERSION 0.2.7 LANGUAGES C CXX ASM)
project(SyterKit VERSION 0.2.8 LANGUAGES C CXX ASM)

# Include other CMake modules
include(cmake/add_syterkit_app.cmake)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "SyterKit"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "0.2.7.1"
PROJECT_NUMBER = "0.2.8.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions board/100ask-d1-h/hello_world/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ extern sunxi_serial_t uart_dbg;
int main(void) {
sunxi_serial_init(&uart_dbg);

printk(LOG_LEVEL_INFO, "Hello World!\n");
printk_info("Hello World!\n");

sunxi_clk_dump();

sunxi_clk_init();

sunxi_clk_dump();

printk(LOG_LEVEL_INFO, "Hello World!\n");
printk_info("Hello World!\n");

return 0;
}
4 changes: 2 additions & 2 deletions board/100ask-d1-h/init_dram/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ int main(void) {

sunxi_clk_dump();

printk(LOG_LEVEL_INFO, "DRAM: DRAM Size = %dMB\n", sunxi_dram_init(&dram_para));
printk_info("DRAM: DRAM Size = %dMB\n", sunxi_dram_init(&dram_para));

sunxi_clk_dump();

int i = 0;

while (1) {
i++;
printk(LOG_LEVEL_INFO, "Count: %d\n", i);
printk_info("Count: %d\n", i);
mdelay(1000);
}

Expand Down
34 changes: 17 additions & 17 deletions board/100ask-d1-h/load_hifi4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int fatfs_loadimage(char *filename, BYTE *dest) {

fret = f_open(&file, filename, FA_OPEN_EXISTING | FA_READ);
if (fret != FR_OK) {
printk(LOG_LEVEL_ERROR, "FATFS: open, filename: [%s]: error %d\n", filename, fret);
printk_error("FATFS: open, filename: [%s]: error %d\n", filename, fret);
ret = -1;
goto open_fail;
}
Expand All @@ -75,7 +75,7 @@ static int fatfs_loadimage(char *filename, BYTE *dest) {
time = time_ms() - start + 1;

if (fret != FR_OK) {
printk(LOG_LEVEL_ERROR, "FATFS: read: error %d\n", fret);
printk_error("FATFS: read: error %d\n", fret);
ret = -1;
goto read_fail;
}
Expand All @@ -84,7 +84,7 @@ static int fatfs_loadimage(char *filename, BYTE *dest) {
read_fail:
fret = f_close(&file);

printk(LOG_LEVEL_DEBUG, "FATFS: read in %ums at %.2fMB/S\n", time, (f32) (total_read / time) / 1024.0f);
printk_debug("FATFS: read in %ums at %.2fMB/S\n", time, (f32) (total_read / time) / 1024.0f);

open_fail:
return ret;
Expand All @@ -101,34 +101,34 @@ static int load_sdcard(image_info_t *image) {
sdmmc_blk_read(&card0, (uint8_t *) (SDRAM_BASE), 0,
CONFIG_SDMMC_SPEED_TEST_SIZE);
test_time = time_ms() - start;
printk(LOG_LEVEL_DEBUG, "SDMMC: speedtest %uKB in %ums at %uKB/S\n",
printk_debug("SDMMC: speedtest %uKB in %ums at %uKB/S\n",
(CONFIG_SDMMC_SPEED_TEST_SIZE * 512) / 1024, test_time,
(CONFIG_SDMMC_SPEED_TEST_SIZE * 512) / test_time);

start = time_ms();

fret = f_mount(&fs, "", 1);
if (fret != FR_OK) {
printk(LOG_LEVEL_ERROR, "FATFS: mount error: %d\n", fret);
printk_error("FATFS: mount error: %d\n", fret);
return -1;
} else {
printk(LOG_LEVEL_DEBUG, "FATFS: mount OK\n");
printk_debug("FATFS: mount OK\n");
}

printk(LOG_LEVEL_INFO, "FATFS: read %s addr=%x\n", image->filename, (unsigned int) image->dest);
printk_info("FATFS: read %s addr=%x\n", image->filename, (unsigned int) image->dest);
ret = fatfs_loadimage(image->filename, image->dest);
if (ret)
return ret;

/* umount fs */
fret = f_mount(0, "", 0);
if (fret != FR_OK) {
printk(LOG_LEVEL_ERROR, "FATFS: unmount error %d\n", fret);
printk_error("FATFS: unmount error %d\n", fret);
return -1;
} else {
printk(LOG_LEVEL_DEBUG, "FATFS: unmount OK\n");
printk_debug("FATFS: unmount OK\n");
}
printk(LOG_LEVEL_DEBUG, "FATFS: done in %ums\n", time_ms() - start);
printk_debug("FATFS: done in %ums\n", time_ms() - start);

return 0;
}
Expand Down Expand Up @@ -168,21 +168,21 @@ int main(void) {

// Initialize SDHCI controller
if (sunxi_sdhci_init(&sdhci0) != 0) {
printk(LOG_LEVEL_ERROR, "SMHC: %s controller init failed\n", sdhci0.name);
printk_error("SMHC: %s controller init failed\n", sdhci0.name);
return 0;
} else {
printk(LOG_LEVEL_INFO, "SMHC: %s controller v%x initialized\n", sdhci0.name, sdhci0.reg->vers);
printk_info("SMHC: %s controller v%x initialized\n", sdhci0.name, sdhci0.reg->vers);
}

// Initialize SD/MMC card
if (sdmmc_init(&card0, &sdhci0) != 0) {
printk(LOG_LEVEL_ERROR, "SMHC: init failed\n");
printk_error("SMHC: init failed\n");
return 0;
}

// Load image from SD card
if (load_sdcard(&image) != 0) {
printk(LOG_LEVEL_ERROR, "SMHC: loading failed\n");
printk_error("SMHC: loading failed\n");
return 0;
}

Expand All @@ -201,16 +201,16 @@ int main(void) {

// Get entry address of HIFI4 ELF
uint32_t elf_run_addr = elf32_get_entry_addr((phys_addr_t) image.dest);
printk(LOG_LEVEL_INFO, "HIFI4 ELF run addr: 0x%08x\n", elf_run_addr);
printk_info("HIFI4 ELF run addr: 0x%08x\n", elf_run_addr);

sunxi_hifi4_clock_init(elf_run_addr);// Initialize clock with entry address

// Load HIFI4 ELF image
if (load_elf32_image_remap((phys_addr_t) image.dest, &hifi4_addr_mapping)) {
printk(LOG_LEVEL_ERROR, "HIFI4 ELF load FAIL\n");
printk_error("HIFI4 ELF load FAIL\n");
}

printk(LOG_LEVEL_INFO, "HIFI4 Core now Running... \n");
printk_info("HIFI4 Core now Running... \n");

cmd_boot(0, NULL);

Expand Down
Loading

0 comments on commit 4155430

Please sign in to comment.