Commit 647187c9 authored by Maciej Lipinski's avatar Maciej Lipinski

HAL: add function to read FPGA/HW temperature (from Tom's commit)

NOTE: work ported from Tom's commits on Low Phase Drift Calibration
parent 670794fe
...@@ -35,6 +35,7 @@ static char *dotconfigname = "/wr/etc/dot-config"; ...@@ -35,6 +35,7 @@ static char *dotconfigname = "/wr/etc/dot-config";
struct hal_shmem_header *hal_shmem; struct hal_shmem_header *hal_shmem;
struct wrs_shm_head *hal_shmem_hdr; struct wrs_shm_head *hal_shmem_hdr;
struct hal_temp_sensors temp_sensors;
/* Adds a function to be called during the HAL shutdown. */ /* Adds a function to be called during the HAL shutdown. */
int hal_add_cleanup_callback(hal_cleanup_callback_t cb) int hal_add_cleanup_callback(hal_cleanup_callback_t cb)
...@@ -223,9 +224,13 @@ static void hal_parse_cmdline(int argc, char *argv[]) ...@@ -223,9 +224,13 @@ static void hal_parse_cmdline(int argc, char *argv[])
} }
} }
int hal_get_fpga_temperature()
{
return temp_sensors.fpga;
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct hal_temp_sensors temp_sensors; /* local copy of temperatures */
static timeout_t update_fan_tmo; static timeout_t update_fan_tmo;
static timeout_t update_all_tmo; static timeout_t update_all_tmo;
......
...@@ -40,5 +40,6 @@ int hal_init_timing(char *filename); ...@@ -40,5 +40,6 @@ int hal_init_timing(char *filename);
int hal_get_timing_mode(void); int hal_get_timing_mode(void);
int hal_update_timing_mode(void); int hal_update_timing_mode(void);
int hal_port_pshifter_busy(void); int hal_port_pshifter_busy(void);
int hal_get_fpga_temperature(void);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment