Commit d19aa22e authored by Jean-Claude BAU's avatar Jean-Claude BAU Committed by 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 f2378553
......@@ -64,6 +64,7 @@ static char *dotconfigname = "/wr/etc/dot-config";
struct hal_shmem_header *hal_shmem;
struct wrs_shm_head *hal_shmem_hdr;
struct hal_temp_sensors temp_sensors;
/* Adds a function to be called during the HAL shutdown. */
int hal_add_cleanup_callback(hal_cleanup_callback_t cb)
......@@ -251,7 +252,6 @@ static void hal_parse_cmdline(int argc, char *argv[])
}
static void cb_timer_update_fan(int timerId) {
struct hal_temp_sensors temp_sensors; /* local copy of temperatures */
/* Update fans and get temperatures values. Don't write
* temperatures directly to the shmem to reduce the
......@@ -267,6 +267,11 @@ static void cb_timer_update_all(int timerId) {
hal_port_update_all();
}
int hal_get_fpga_temperature(void)
{
return temp_sensors.fpga;
}
int main(int argc, char *argv[])
{
......
/*
* Copyright (C) 2019 CERN (www.cern.ch)
* Author: Jean-Claude BAU - CERN
*
* Released according to the GNU LGPL, version 2.1 or any later version.
*
*
*/
#ifndef HAL_MAIN_H
#define HAL_MAIN_H
extern int hal_tmg_set_mode(uint32_t tm);
extern int hal_tmg_get_mode(void);
extern int hal_get_fpga_temperature(void);
#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