Skip to content

Commit 228060f

Browse files
committed
code style fix ARMmbed#2
1 parent 0c51a31 commit 228060f

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/analogin_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ float analogin_read(analogin_t *obj){
135135
uint32_t AnaloginDatMsk = 0xFFFF;
136136
uint8_t AnaloginIdx = 0;
137137
uint32_t AnalogDat = 0;
138-
uint32_t Offset = 0x2980;
138+
139+
//no auto-calibration implemented yet, uses hard coded calibrate
140+
uint32_t Offset = 0x2980;
139141
uint32_t AnalogDatFull = 0xAA00;
140142

141143
PSAL_ADC_MNGT_ADPT pSalADCMngtAdpt = NULL;

targets/TARGET_Realtek/TARGET_AMEBA/flash_api.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ void flash_init(flash_t *obj)
8181
}
8282
flashobj.SpicInitPara.flashtype = SpicInitParaAllClk[0][0].flashtype;
8383

84-
//DBG_8195A("Flash ID is = %x %x %x \n",SpicInitParaAllClk[0][0].id[0],SpicInitParaAllClk[0][0].id[1],SpicInitParaAllClk[0][0].id[2]);
85-
8684
}
8785
void flash_turnon()
8886
{
@@ -474,7 +472,7 @@ int flash_burst_read(flash_t *obj, uint32_t address, uint32_t Length, uint8_t *
474472

475473
// Wait flash busy done (wip=0)
476474
SpicWaitWipDoneRefinedRtl8195A(flashobj.SpicInitPara);
477-
SpicUserReadRtl8195A(Length, address, data,SpicOneBitMode);
475+
SpicUserReadRtl8195A(Length, address, data, SpicOneBitMode);
478476
SpicDisableRtl8195A();
479477
return 1;
480478
}

targets/TARGET_Realtek/TARGET_AMEBA/i2c_api.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -554,17 +554,6 @@ int i2c_slave_write(i2c_t *obj, const char *data, int length) {
554554
return 1;
555555
}
556556

557-
/** \brief Description of i2c_slave_set_for_rd_req
558-
*
559-
* i2c_slave_set_for_rd_req is used to set/clear i2c slave RD_REQ interrupt mask.
560-
* If RD_REQ interrupt is set, slave could invoke read request callback when it gets
561-
* a read command from other i2c master.
562-
*
563-
* \param i2c_t *obj : i2c object
564-
* \param int set : set or clear for read request. Once it's set, i2c would invoke read request callback when a
565-
* read command is sent to it.
566-
* \return result
567-
*/
568557
#endif // CONFIG_I2C_SLAVE_EN
569558

570559
#endif // CONFIG_I2C_EN

targets/TARGET_Realtek/TARGET_AMEBA/us_ticker.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ uint32_t us_ticker_read()
6666

6767
tick_cnt = HalTimerOp.HalTimerReadCount(SYS_TIM_ID);
6868
tick_cnt = 0xffffffff - tick_cnt; // it's a down counter
69-
ticks_125ms = tick_cnt/(GTIMER_CLK_HZ/8);
70-
ticks_remain = tick_cnt - (ticks_125ms*(GTIMER_CLK_HZ/8));
71-
us_tick = ticks_125ms * 125000;
72-
us_tick += (ticks_remain * 1000000)/GTIMER_CLK_HZ;
69+
ticks_125ms = tick_cnt/(GTIMER_CLK_HZ/8); //use 125ms as a intermediate unit;
70+
ticks_remain = tick_cnt - (ticks_125ms*(GTIMER_CLK_HZ/8)); //calculate the remainder
71+
us_tick = ticks_125ms * 125000; //change unit to us, 125ms is 125000 us
72+
us_tick += (ticks_remain * 1000000)/GTIMER_CLK_HZ; //also use us as unit
7373

74-
return ((uint32_t)us_tick);
74+
return ((uint32_t)us_tick); //return ticker value in micro-seconds (us)
7575
}
7676

7777
void us_ticker_set_interrupt(timestamp_t timestamp)

0 commit comments

Comments
 (0)