mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 02:20:42 +02:00
Dev/g2 fix configure chip startup (#1009)
* g2: chip reconfigure variable not set when powering on at startup because readconfig is the one configuring the chip the first time to default chip settings * cleaning up code
This commit is contained in:
parent
6fcdba56a4
commit
37e65634d4
Binary file not shown.
@ -987,6 +987,8 @@ int readConfigFile() {
|
|||||||
|
|
||||||
// to inform powerchip config parameters are set
|
// to inform powerchip config parameters are set
|
||||||
startupPowerChipConfigDone = 1;
|
startupPowerChipConfigDone = 1;
|
||||||
|
chipConfigured = 1;
|
||||||
|
LOG(logINFOBLUE, ("Chip configured\n"));
|
||||||
}
|
}
|
||||||
return initError;
|
return initError;
|
||||||
}
|
}
|
||||||
@ -2278,8 +2280,7 @@ int powerChip(int on, char *mess) {
|
|||||||
if (on) {
|
if (on) {
|
||||||
LOG(logINFO, ("Powering chip: on\n"));
|
LOG(logINFO, ("Powering chip: on\n"));
|
||||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK);
|
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK);
|
||||||
// only if power chip config done, configure chip with current set up
|
if (configureChip(mess) == FAIL)
|
||||||
if (startupPowerChipConfigDone == 1 && configureChip(mess) == FAIL)
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
} else {
|
} else {
|
||||||
// throw if high voltage on
|
// throw if high voltage on
|
||||||
@ -2310,6 +2311,12 @@ int getPowerChip() {
|
|||||||
int isChipConfigured() { return chipConfigured; }
|
int isChipConfigured() { return chipConfigured; }
|
||||||
|
|
||||||
int configureChip(char *mess) {
|
int configureChip(char *mess) {
|
||||||
|
|
||||||
|
if (!startupPowerChipConfigDone) {
|
||||||
|
LOG(logINFOBLUE,
|
||||||
|
("Startup: Chip to be configured when reading config file\n"));
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
LOG(logINFOBLUE, ("\tConfiguring chip\n"));
|
LOG(logINFOBLUE, ("\tConfiguring chip\n"));
|
||||||
|
|
||||||
// on chip dacs
|
// on chip dacs
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
#define APIEIGER "developer 0x240918"
|
#define APIEIGER "developer 0x240918"
|
||||||
#define APIMYTHEN3 "developer 0x241001"
|
#define APIMYTHEN3 "developer 0x241001"
|
||||||
#define APIJUNGFRAU "developer 0x241001"
|
#define APIJUNGFRAU "developer 0x241001"
|
||||||
#define APIGOTTHARD2 "developer 0x241007"
|
|
||||||
#define APIRECEIVER "developer 0x241014"
|
#define APIRECEIVER "developer 0x241014"
|
||||||
#define APILIB "developer 0x241021"
|
#define APILIB "developer 0x241021"
|
||||||
|
#define APIGOTTHARD2 "developer 0x241022"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user