Skip to content

Commit

Permalink
code style fix ARMmbed#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Archcady committed Apr 17, 2017
1 parent a26449f commit bdc67bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
4 changes: 3 additions & 1 deletion targets/TARGET_Realtek/TARGET_AMEBA/analogin_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ float analogin_read(analogin_t *obj){
uint32_t AnaloginDatMsk = 0xFFFF;
uint8_t AnaloginIdx = 0;
uint32_t AnalogDat = 0;
uint32_t Offset = 0x2980;

//no auto-calibration implemented yet, uses hard coded calibrate
uint32_t Offset = 0x2980;
uint32_t AnalogDatFull = 0xAA00;

PSAL_ADC_MNGT_ADPT pSalADCMngtAdpt = NULL;
Expand Down
4 changes: 1 addition & 3 deletions targets/TARGET_Realtek/TARGET_AMEBA/flash_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ void flash_init(flash_t *obj)
}
flashobj.SpicInitPara.flashtype = SpicInitParaAllClk[0][0].flashtype;

//DBG_8195A("Flash ID is = %x %x %x \n",SpicInitParaAllClk[0][0].id[0],SpicInitParaAllClk[0][0].id[1],SpicInitParaAllClk[0][0].id[2]);

}
void flash_turnon()
{
Expand Down Expand Up @@ -474,7 +472,7 @@ int flash_burst_read(flash_t *obj, uint32_t address, uint32_t Length, uint8_t *

// Wait flash busy done (wip=0)
SpicWaitWipDoneRefinedRtl8195A(flashobj.SpicInitPara);
SpicUserReadRtl8195A(Length, address, data,SpicOneBitMode);
SpicUserReadRtl8195A(Length, address, data, SpicOneBitMode);
SpicDisableRtl8195A();
return 1;
}
Expand Down
11 changes: 0 additions & 11 deletions targets/TARGET_Realtek/TARGET_AMEBA/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,17 +554,6 @@ int i2c_slave_write(i2c_t *obj, const char *data, int length) {
return 1;
}

/** \brief Description of i2c_slave_set_for_rd_req
*
* i2c_slave_set_for_rd_req is used to set/clear i2c slave RD_REQ interrupt mask.
* If RD_REQ interrupt is set, slave could invoke read request callback when it gets
* a read command from other i2c master.
*
* \param i2c_t *obj : i2c object
* \param int set : set or clear for read request. Once it's set, i2c would invoke read request callback when a
* read command is sent to it.
* \return result
*/
#endif // CONFIG_I2C_SLAVE_EN

#endif // CONFIG_I2C_EN
Expand Down
10 changes: 5 additions & 5 deletions targets/TARGET_Realtek/TARGET_AMEBA/us_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ uint32_t us_ticker_read()

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

return ((uint32_t)us_tick);
return ((uint32_t)us_tick); //return ticker value in micro-seconds (us)
}

void us_ticker_set_interrupt(timestamp_t timestamp)
Expand Down

0 comments on commit bdc67bd

Please sign in to comment.