From 1185bd2bb58da6239fc031b8e6034992d6fc3cc0 Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 6 Sep 2011 11:51:41 +0000 Subject: [PATCH] Comply struct names to conding style. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5030 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/drv/sd_sam3.c | 36 +++++++++++++++--------------- bertos/drv/sd.h | 12 +++++----- bertos/drv/sd_spi.c | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bertos/cpu/cortex-m3/drv/sd_sam3.c b/bertos/cpu/cortex-m3/drv/sd_sam3.c index 3c228347..aa53ecc0 100644 --- a/bertos/cpu/cortex-m3/drv/sd_sam3.c +++ b/bertos/cpu/cortex-m3/drv/sd_sam3.c @@ -83,22 +83,22 @@ static const uint8_t tran_mant[] = }; -void sd_dumpCsd(SDcsd *csd); -void sd_dumpCid(SDcid *cid); -void sd_dumpSsr(SDssr *ssr); +void sd_dumpCsd(SdCSD *csd); +void sd_dumpCid(SdCID *cid); +void sd_dumpSsr(SdSSR *ssr); void sd_sendInit(void); void sd_goIdle(void); int sd_sendIfCond(Sd *sd); int sd_sendAppOpCond(Sd *sd); -int sd_getCid(Sd *sd, SDcid *cid, uint32_t addr, uint8_t flag); -int sd_getCsd(Sd *sd, SDcsd *csd); +int sd_getCid(Sd *sd, SdCID *cid, uint32_t addr, uint8_t flag); +int sd_getCsd(Sd *sd, SdCSD *csd); int sd_getSrc(Sd *sd); int sd_appStatus(Sd *sd); int sd_getRelativeAddr(Sd *sd); -int sd_getStatus(Sd *sd, SDssr *ssr, uint32_t *buf, size_t words); +int sd_getStatus(Sd *sd, SdSSR *ssr, uint32_t *buf, size_t words); int sd_selectCard(Sd *sd); int sd_deSelectCard(Sd *sd); @@ -139,7 +139,7 @@ static void dump(const char *label, uint32_t *r, size_t len) } ) -void sd_dumpCsd(SDcsd *csd) +void sd_dumpCsd(SdCSD *csd) { ASSERT(csd); @@ -157,7 +157,7 @@ void sd_dumpCsd(SDcsd *csd) } -void sd_dumpCid(SDcid *cid) +void sd_dumpCid(SdCID *cid) { ASSERT(cid); @@ -170,7 +170,7 @@ void sd_dumpCid(SDcid *cid) (BCD_TO_INT_32BIT(cid->year_off) % 12)); } -void sd_dumpSsr(SDssr *ssr) +void sd_dumpSsr(SdSSR *ssr) { ASSERT(ssr); @@ -182,7 +182,7 @@ void sd_dumpSsr(SDssr *ssr) } -static int sd_decodeCsd(SDcsd *csd, uint32_t *resp, size_t len) +static int sd_decodeCsd(SdCSD *csd, uint32_t *resp, size_t len) { ASSERT(csd); ASSERT(resp); @@ -327,11 +327,11 @@ int sd_sendAppOpCond(Sd *sd) } -int sd_getCid(Sd *sd, SDcid *cid, uint32_t addr, uint8_t flag) +int sd_getCid(Sd *sd, SdCID *cid, uint32_t addr, uint8_t flag) { ASSERT(sd); ASSERT(cid); - memset(cid, 0, sizeof(SDcid)); + memset(cid, 0, sizeof(SdCID)); uint8_t idx = 9; // CMD9 get cid from gived sd address (RCA) if (flag & SD_SEND_ALL_CID) @@ -365,11 +365,11 @@ int sd_getCid(Sd *sd, SDcid *cid, uint32_t addr, uint8_t flag) return 0; } -int sd_getCsd(Sd *sd, SDcsd *csd) +int sd_getCsd(Sd *sd, SdCSD *csd) { ASSERT(sd); ASSERT(csd); - memset(csd, 0, sizeof(SDcsd)); + memset(csd, 0, sizeof(SdCSD)); LOG_INFO("Send to RCA: %lx\n", SD_ADDR_TO_RCA(sd->addr)); if (hsmci_sendCmd(9, SD_ADDR_TO_RCA(sd->addr), HSMCI_CMDR_RSPTYP_136_BIT)) @@ -553,7 +553,7 @@ int sd_set_BlockLen(Sd *sd, size_t len) return -1; } -int sd_getStatus(Sd *sd, SDssr *ssr, uint32_t *buf, size_t words) +int sd_getStatus(Sd *sd, SdSSR *ssr, uint32_t *buf, size_t words) { ASSERT(sd); ASSERT(ssr); @@ -586,7 +586,7 @@ int sd_getStatus(Sd *sd, SDssr *ssr, uint32_t *buf, size_t words) hsmci_waitTransfer(); LOG_INFOB(dump("STATUS", buf, words);); - memset(ssr, 0, sizeof(SDssr)); + memset(ssr, 0, sizeof(SdSSR)); ssr->bus_width = UNSTUFF_BITS(buf, 510, 2); ssr->card_type = UNSTUFF_BITS(buf, 480, 16); ssr->au_size = UNSTUFF_BITS(buf, 432, 8); @@ -722,7 +722,7 @@ static bool sd_blockInit(Sd *sd, KFile *ch) if (sd_power_on) { - SDcid cid; + SdCID cid; if(sd_getCid(sd, &cid, 0, SD_SEND_ALL_CID) < 0) return false; else @@ -737,7 +737,7 @@ static bool sd_blockInit(Sd *sd, KFile *ch) LOG_INFO("RCA: %0lx\n", sd->addr); } - SDcsd csd; + SdCSD csd; if (sd_getCsd(sd, &csd) < 0) return false; else diff --git a/bertos/drv/sd.h b/bertos/drv/sd.h index 5c876c46..8b85240a 100644 --- a/bertos/drv/sd.h +++ b/bertos/drv/sd.h @@ -51,7 +51,7 @@ #include -typedef struct SDcid +typedef struct SdCID { uint8_t manfid; uint8_t prod_name[8]; @@ -60,9 +60,9 @@ typedef struct SDcid uint32_t year_off; uint8_t m_rev; uint8_t l_rev; -}SDcid; +}SdCID; -typedef struct SDcsd +typedef struct SdCSD { uint8_t structure; uint8_t ccc; ///< Card command classes @@ -77,16 +77,16 @@ typedef struct SDcsd read_misalign:1, write_partial:1, write_misalign:1; -} SDcsd; +} SdCSD; -typedef struct SDssr +typedef struct SdSSR { uint8_t bus_width; uint8_t card_type; uint8_t speed_class; uint8_t au_size; uint8_t erase_size; -} SDssr; +} SdSSR; #define SD_START_DELAY 10 #define SD_INIT_TIMEOUT ms_to_ticks(2000) diff --git a/bertos/drv/sd_spi.c b/bertos/drv/sd_spi.c index 442db9e3..6336ebbd 100644 --- a/bertos/drv/sd_spi.c +++ b/bertos/drv/sd_spi.c @@ -189,7 +189,7 @@ static int16_t sd_setBlockLen(Sd *sd, uint32_t newlen) #define SD_SEND_CSD 0x49 -static int16_t sd_getCSD(Sd *sd, SDcsd *csd) +static int16_t sd_getCSD(Sd *sd, SdCSD *csd) { SD_SELECT(sd); @@ -406,7 +406,7 @@ static bool sd_blockInit(Sd *sd, KFile *ch) } /* Avoid warning for uninitialized csd use (gcc bug?) */ - SDcsd csd = csd; + SdCSD csd = csd; sd->status = sd_getCSD(sd, &csd); -- 2.25.1