#define DAS16_TIMEOUT 1000
-/* period for timer interrupt in jiffies */
-static const int timer_period = HZ / 20;
-
+/* Period for timer interrupt in jiffies. It's a function
+ * to deal with possibility of dynamic HZ patches */
+static inline int timer_period(void)
+{
+ return HZ / 20;
+}
struct das16_private_struct
{
unsigned int ai_unipolar; // unipolar flag
if( devpriv->timer_mode )
{
devpriv->timer_running = 1;
- devpriv->timer.expires = jiffies + timer_period;
+ devpriv->timer.expires = jiffies + timer_period();
add_timer(&devpriv->timer);
devpriv->control_state &= ~DAS16_INTE;
}else
das16_interrupt(dev);
if(devpriv->timer_running)
- mod_timer(&devpriv->timer, jiffies + timer_period);
+ mod_timer(&devpriv->timer, jiffies + timer_period());
}
static void das16_interrupt( comedi_device *dev )
{
int i;
unsigned short status;
- static const int timeout = HZ;
+ int timeout = HZ;
ni_ao_win_outw(dev, ((value >> 16) & 0xff), CAL_ADC_Config_Data_High_Word_67xx);
ni_ao_win_outw(dev, (value & 0xffff), CAL_ADC_Config_Data_Low_Word_67xx);
int i;
unsigned short status;
unsigned int value;
- static const int timeout = HZ;
+ int timeout = HZ;
reg_select_bits &= CSCMD_REGISTER_SELECT_MASK;
cs5529_command(dev, CSCMD_COMMAND | CSCMD_READ | reg_select_bits);
static int cs5529_do_conversion(comedi_device *dev, unsigned short *data)
{
int i;
- static const int timeout = HZ;
+ int timeout = HZ;
unsigned int status;
cs5529_command(dev, CSCMD_COMMAND | CSCMD_SINGLE_CONVERSION);