summaryrefslogtreecommitdiff
path: root/bsp/simulator
diff options
context:
space:
mode:
authorMeco Jianting Man <[email protected]>2021-06-05 13:03:45 +0800
committerGitHub <[email protected]>2021-06-05 13:03:45 +0800
commitbfd8d21e388befc5d971075db5af0ed561abb4f2 (patch)
treed5caabadeb30fc67b3e0efa6dad251617639e096 /bsp/simulator
parent02331fd30d1f1ca8c886aac4db6c8c111987913c (diff)
parent28847008171ab7423b6b05b7157d3467f1525fda (diff)
Merge branch 'master' into mutexrevert
Diffstat (limited to 'bsp/simulator')
-rwxr-xr-xbsp/simulator/drivers/sd_sim.c20
-rwxr-xr-xbsp/simulator/drivers/sdl_fb.c2
-rw-r--r--bsp/simulator/drivers/sst25vfxx_mtd_sim.c2
3 files changed, 11 insertions, 13 deletions
diff --git a/bsp/simulator/drivers/sd_sim.c b/bsp/simulator/drivers/sd_sim.c
index adc489be20..7557fac12c 100755
--- a/bsp/simulator/drivers/sd_sim.c
+++ b/bsp/simulator/drivers/sd_sim.c
@@ -13,11 +13,9 @@
#include <rtthread.h>
#include <dfs.h>
-#ifdef DEBUG
-# define SD_TRACE rt_kprintf
-#else
-# define SD_TRACE(...)
-#endif
+#define DBG_TAG "sd.sim"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.h>
#define SDCARD_SIM "sd.bin"
#define SDCARD_SIZE (16*1024*1024) //16M
@@ -59,7 +57,7 @@ static rt_size_t rt_sdcard_read(rt_device_t device, rt_off_t position, void *buf
struct sdcard_device *sd;
int result = 0;
- SD_TRACE("sd read: pos %d, size %d\n", position, size);
+ LOG_I("sd read: pos %d, size %d", position, size);
rt_mutex_take(lock, RT_WAITING_FOREVER);
sd = SDCARD_DEVICE(device);
@@ -73,7 +71,7 @@ static rt_size_t rt_sdcard_read(rt_device_t device, rt_off_t position, void *buf
return size;
_err:
- SD_TRACE("sd read errors!\n");
+ LOG_E("sd read errors!");
rt_mutex_release(lock);
return 0;
}
@@ -87,7 +85,7 @@ static rt_size_t rt_sdcard_write(rt_device_t device, rt_off_t position, const vo
struct sdcard_device *sd;
int result = 0;
- SD_TRACE("sst write: pos %d, size %d\n", position, size);
+ LOG_I("sst write: pos %d, size %d", position, size);
rt_mutex_take(lock, RT_WAITING_FOREVER);
sd = SDCARD_DEVICE(device);
@@ -101,7 +99,7 @@ static rt_size_t rt_sdcard_write(rt_device_t device, rt_off_t position, const vo
return size;
_err:
- SD_TRACE("sd write errors!\n");
+ LOG_E("sd write errors!");
rt_mutex_release(lock);
return 0;
}
@@ -143,7 +141,7 @@ rt_err_t rt_hw_sdcard_init(const char *spi_device_name)
device = &(sd->parent);
lock = rt_mutex_create("lock", RT_IPC_FLAG_FIFO);
- if (lock == RT_NULL)
+ if (lock == RT_NULL)
{
LOG_E("Create mutex in rt_hw_sdcard_init failed!");
return -RT_ERROR;
@@ -168,7 +166,7 @@ rt_err_t rt_hw_sdcard_init(const char *spi_device_name)
ptr = (unsigned char *) malloc(1024 * 1024);
if (ptr == NULL)
{
- SD_TRACE("malloc error, no memory!\n");
+ LOG_E("malloc error, no memory!");
return RT_ERROR;
}
memset(ptr, 0x0, 1024 * 1024);
diff --git a/bsp/simulator/drivers/sdl_fb.c b/bsp/simulator/drivers/sdl_fb.c
index 7b25da9c3c..995b12219e 100755
--- a/bsp/simulator/drivers/sdl_fb.c
+++ b/bsp/simulator/drivers/sdl_fb.c
@@ -221,7 +221,7 @@ static void sdlfb_hw_init(void)
rt_device_register(RT_DEVICE(&_device), "sdl", RT_DEVICE_FLAG_RDWR);
sdllock = rt_mutex_create("fb", RT_IPC_FLAG_FIFO);
- if (sdllock == RT_NULL)
+ if (sdllock == RT_NULL)
{
LOG_E("Create mutex for sdlfb failed!");
}
diff --git a/bsp/simulator/drivers/sst25vfxx_mtd_sim.c b/bsp/simulator/drivers/sst25vfxx_mtd_sim.c
index 4460e1da3b..bc44699a10 100644
--- a/bsp/simulator/drivers/sst25vfxx_mtd_sim.c
+++ b/bsp/simulator/drivers/sst25vfxx_mtd_sim.c
@@ -16,7 +16,7 @@
#ifdef RT_USING_MTD_NOR
#define NOR_SIM "nor.bin"
-/* JEDEC Manufacturer’s ID */
+/* JEDEC Manufacturer's ID */
#define MF_ID (0xBF)
/* JEDEC Device ID : Memory Type */
#define MT_ID (0x25)