title: Timer 0 interruption on PIC18F
body: <p>I am trying to make a program, that use a interruption for timer 0. The problem is I have to add a function with 2 variables. 
  Timer configuration will be performed by defining a function with the following prototype: void int_tmr0 (int conf_int, int conf_T0), which I did it in that form:</p>
  
  <pre><code>void conf(int p1, int p2)
      {
          T0CON=p1;
          INTCON=p2;
      }
  </code></pre>
  
  <p>I try to put the records: T0CON, INTCON in these 2 variables: p1 and p2.
  I am not sure if I can call these 2 variables in the main function by:</p>
  
  <pre><code>    void main()
      {
          WDTCONbits.ADSHR = 1;
          MEMCONbits.EBDIS = 1;
          TRISD = 0x0;
          INTCONbits.GIE = 1;
          p1=0b10001000;
          INTCONbits.TMR0IE = 0;
      }
  </code></pre>
  
  <p>Here is the whole code:</p>
  
  <pre><code>#include &lt;xc.h&gt;
  
  unsigned char counter;
  
  void interrupt f1()
  {
      if(INTCONbits.TMR0IE &amp;&amp; INTCONbits.TMR0IF)
      {
          counter++;
          INTCONbits.TMROIF=0     
      }
  
  void conf(int p1, int p2)
      {
          T0CON=p1;
          INTCON=p2;
      }
  
      void main()
      {
          WDTCONbits.ADSHR = 1;
          MEMCONbits.EBDIS = 1;
          TRISD = 0x0;
          INTCONbits.GIE = 1;
          p1=0b10001000;
          INTCONbits.TMR0IE = 0;
      }
      while(1){
          LATD= counter;
      }
  }
  </code></pre>