rst to sw1 for all

This commit is contained in:
Dhanya Maliakal
2017-08-16 16:03:57 +02:00
parent 509d81ba7d
commit f4b01bc18b
5 changed files with 15 additions and 26 deletions

View File

@ -244,15 +244,6 @@ u_int32_t bus_r(u_int32_t offset) {
void setMasterSlaveConfiguration(){
/*
int masterflags = NO_MASTER;
int masterdefaultdelay = 62;
int patternphase = 0;
int adcphase = 0;
int slavepatternphase = 0;
int slaveadcphase = 0;
int sw1torstdelay = 2;
*/
// global master default delay picked from config file
FILE* fd=fopen(CONFIG_FILE,"r");
if(fd==NULL){
@ -354,17 +345,15 @@ void setMasterSlaveConfiguration(){
setPhaseShift(slaveadcphase);
}
/* Set RST to SW1 delay */
val=bus_r(MULTI_PURPOSE_REG);
//#ifdef VERBOSE
printf("Value of multipurpose reg:%d\n",bus_r(MULTI_PURPOSE_REG));
//#endif
val = (val & (~(RST_TO_SW1_DELAY_MSK))) | ((rsttosw1delay << RST_TO_SW1_DELAY_OFFSET) & (RST_TO_SW1_DELAY_MSK));
bus_w(MULTI_PURPOSE_REG,val);
if (masterflags == IS_MASTER || masterflags == IS_SLAVE) {
val=bus_r(MULTI_PURPOSE_REG);
//#ifdef VERBOSE
printf("Value of multipurpose reg:%d\n",bus_r(MULTI_PURPOSE_REG));
//#endif
val = (val & (~(RST_TO_SW1_DELAY_MSK))) | ((rsttosw1delay << RST_TO_SW1_DELAY_OFFSET) & (RST_TO_SW1_DELAY_MSK));
bus_w(MULTI_PURPOSE_REG,val);
}
fclose(fd);
}