Ejemplo n.º 1
0
            scan_start(i);
            while(!(TSI0_GENCS & TSI_GENCS_EOSF_MASK))      // Wait until done
                ;

            base_counts[i] = scan_data();
            first_channel = i;
        }
    }
    
    // Enable TSI interrupts and start the first scan
    enable_irq(INT_TSI0);
    scan_start(first_channel);
}

// Touch input interrupt handler
void TSI0_IRQHandler() __attribute__((interrupt("IRQ")));
void TSI0_IRQHandler(void)
{
    // Save data for channel
    uint32_t channel = (TSI0_DATA & TSI_DATA_TSICH_MASK) >> TSI_DATA_TSICH_SHIFT;
    raw_counts[channel] = scan_data();

    // Start a new scan on next enabled channel
    for(;;) {
        channel = (channel + 1) % NCHANNELS;
        if ((1 << channel) & enable_mask) {
            scan_start(channel);
            return;
        }
    }
}
Ejemplo n.º 2
0
    the SafeRTOS brand: http://www.SafeRTOS.com.
*/

/* High speed timer test as described in main.c. */


/* Scheduler includes. */
#include "FreeRTOS.h"

/* The maximum value the 16bit timer can contain. */
#define timerMAX_COUNT				0xffff

/* The timer 2 interrupt handler.  As this interrupt uses the FreeRTOS assembly
entry point the IPL setting in the following function prototype has no effect.
The interrupt priority is set by ConfigIntTimer2() in vSetupTimerTest(). */
void __attribute__( (interrupt(ipl0), vector(_TIMER_2_VECTOR))) vT2InterruptWrapper( void );

/*-----------------------------------------------------------*/

/* Incremented every 20,000 interrupts, so should count in seconds. */
unsigned long ulHighFrequencyTimerInterrupts = 0;

/* The frequency at which the timer is interrupting. */
static unsigned long ulFrequencyHz;

/*-----------------------------------------------------------*/

void vSetupTimerTest( unsigned short usFrequencyHz )
{
	/* Remember the frequency so it can be used from the ISR. */
	ulFrequencyHz = ( unsigned long ) usFrequencyHz;
Ejemplo n.º 3
0
/*********************************************************************************************
* Fichero:		timer2.c
* Autor:		
* Descrip:		funciones de control del timer2 del s3c44b0x
*********************************************************************************************/

/*--- ficheros de cabecera ---*/
#include "44b.h"
#include "44blib.h"

/*--- variables globales ---*/
static int num_interrupts = 0;

/*--- declaracion de funciones ---*/
void timer2_ISR(void) __attribute__ ((interrupt ("IRQ")));
void timer2_init(void);
void timer2_start(void);
int timer2_leer(void);

/*--- codigo de las funciones ---*/
void timer2_ISR(void)
{
	num_interrupts += 1;
	/* borrar bit en I_ISPC para desactivar la solicitud de interrupcion */
	rI_ISPC |= BIT_TIMER2; // BIT_TIMER2 esta definido en 44b.h y pone un uno en el bit 11 que correponde al Timer2.
}

void timer2_start(void)
{
	num_interrupts = 0;
}
Ejemplo n.º 4
0
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"

/* Constants required to handle interrupts. */
#define portTIMER_MATCH_ISR_BIT		( ( unsigned portCHAR ) 0x01 )
#define portCLEAR_VIC_INTERRUPT		( ( unsigned portLONG ) 0 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING		( ( unsigned portLONG ) 0 )
volatile unsigned portLONG ulCriticalNesting = 9999UL;

/*-----------------------------------------------------------*/

/* ISR to handle manual context switches (from a call to taskYIELD()). */
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));

/* 
 * The scheduler can only be started from ARM mode, hence the inclusion of this
 * function here.
 */
void vPortISRStartFirstTask( void );
/*-----------------------------------------------------------*/

void vPortISRStartFirstTask( void )
{
	/* Simply start the scheduler.  This is included here as it can only be
	called from ARM mode. */
	portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/
Ejemplo n.º 5
0
*/

#include "FreeRTOS.h"
#include "IntQueueTimer.h"
#include "IntQueue.h"

#define timerINTERRUPT3_FREQUENCY	( 2000UL )
#define timerINTERRUPT4_FREQUENCY	( 2001UL )

void vT3InterruptHandler( void );
void vT4InterruptHandler( void );

/* As these interrupts use the FreeRTOS interrupt entry point, the IPL settings
in the following prototypes have no effect.  The interrupt priorities are set
by the ConfigIntTimerX() library calls in vInitialiseTimerForIntQueueTest(). */
void __attribute__( (interrupt(ipl0), vector(_TIMER_3_VECTOR))) vT3InterruptWrapper( void );
void __attribute__( (interrupt(ipl0), vector(_TIMER_4_VECTOR))) vT4InterruptWrapper( void );

void vInitialiseTimerForIntQueueTest( void )
{
    /* Timer 1 is used for the tick interrupt, timer 2 is used for the high
    frequency interrupt test.  This file therefore uses timers 3 and 4. */

    T3CON = 0;
    TMR3 = 0;
    PR3 = ( unsigned short ) ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT3_FREQUENCY );

    /* Setup timer 3 interrupt priority to be above the kernel priority. */
    ConfigIntTimer3( T3_INT_ON | ( configMAX_SYSCALL_INTERRUPT_PRIORITY - 1 ) );

    /* Clear the interrupt as a starting condition. */
Ejemplo n.º 6
0
int arabian_interrupt(void)
{
	arabian_clock++;
	return interrupt();
}
Ejemplo n.º 7
0
 singlethreaded::~singlethreaded()
 {
   interrupt();
   wait();
 }
Ejemplo n.º 8
0
#include "FreeRTOS.h"
#include "task.h"

#define portACLK_FREQUENCY_HZ			( ( TickType_t ) 32768 )
#define portINITIAL_CRITICAL_NESTING	( ( uint16_t ) 10 )
#define portFLAGS_INT_ENABLED			( ( StackType_t ) 0x08 )

typedef void TCB_t;
extern volatile TCB_t * volatile pxCurrentTCB;

volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;

void vPortSetupTimerInterrupt( void );
void __attribute__ ( ( interrupt(configTICK_VECTOR) , naked) ) vTickISREntry( void );


StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
{
	uint16_t *pusTopOfStack;
	uint32_t *pulTopOfStack;
	if( sizeof( StackType_t ) == sizeof( uint16_t ) )
	{
		pusTopOfStack = ( uint16_t * ) pxTopOfStack;
		pusTopOfStack--;
		pulTopOfStack = ( uint32_t * ) pusTopOfStack;
	}
	else
	{
		pulTopOfStack = ( uint32_t * ) pxTopOfStack;
	}
	*pulTopOfStack = ( uint32_t ) ( ( portPOINTER_SIZE_TYPE ) pxCode );
Ejemplo n.º 9
0
    temp = IC_FIRQ0_STATUS;
    long_to_hex_string(temp, temp_string, 8);
    uart0_printf("FIRQ Status: ");
    uart0_printf(temp_string);
    uart0_printf(" \r\n");
}
/* ---- IRQ: Timer ISR ---- */
/////////////////////////////////////////////////////////////
// steps to process interrupt
// 1) Clear interrupt in Peripheral IC_INT_SOFTCLEAR_0
// 2) clear interrupt in int controller IC_IRQ0_ENABLECLR
// 3) Do something
// 4) Re-enable interrupt IC_IRQ0_ENABLEST
/////////////////////////////////////////////////////////////
void __attribute__ ((interrupt("IRQ"))) sw_int_proc(void)
{
    io_disable_xint();
    IC_INT_SOFTCLEAR_0 = 0x1;
    IC_IRQ0_ENABLECLR = 0x1;

    uart0_printf("Software Interrupt!\r\n");
    IC_IRQ0_ENABLESET = 0x1;
    io_enable_xint(); // enable IRQ ----still works

    // toggle status led
    // set_syscpreg((get_syscpreg(SYS_IO) ^ 0x01), SYS_IO);
    // // acknowledge interrupt
    // //VICVectAddr = 0;
}
Ejemplo n.º 10
0
volatile uint32_t do_cycle1  = 0;
volatile uint32_t do_cycle2  = 0;
volatile uint32_t do_cycle3  = 0;
volatile uint32_t do_cycle4  = 0;
volatile uint32_t do_cycle5  = 0;
volatile uint32_t do_cycle6  = 0;
volatile uint32_t do_cycle7  = 0;
volatile uint32_t do_cycle8  = 0;
volatile uint32_t do_cycle9  = 0;
volatile uint32_t do_cycle10 = 0;
volatile uint32_t do_cycle11 = 1; // Watch-Dog

//*******************************************************************
// INTERRUPT HANDLERS
//*******************************************************************
void handler_ext_int_wakeup   (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_softreset(void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_gocep    (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_timer32  (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_timer16  (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_mbustx   (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_mbusrx   (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_mbusfwd  (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg0     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg1     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg2     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg3     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg4     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg5     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg6     (void) __attribute__ ((interrupt ("IRQ")));
void handler_ext_int_reg7     (void) __attribute__ ((interrupt ("IRQ")));
Ejemplo n.º 11
0
#endif
  
  cmsis_cv();
  
  #ifdef __MICROLIB
  for(;;) {}
  #else
  exit(0);
  #endif
}

#if defined(__CORTEX_A)
#include "irq_ctrl.h"
#if (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || \
  (defined ( __GNUC__ ))
__attribute__((interrupt("IRQ")))
#elif defined ( __CC_ARM )
__irq
#elif defined ( __ICCARM__ )
__irq __arm
#else
#error "Unsupported compiler!"
#endif
void IRQ_Handler(void) {
  const IRQn_ID_t irqn = IRQ_GetActiveIRQ();
  IRQHandler_t const handler = IRQ_GetHandler(irqn);
  if (handler != NULL) {
    __enable_irq();
    handler();
    __disable_irq();
  }
Ejemplo n.º 12
0
int vindictr_sound_interrupt (void)
{
	return interrupt ();
}
Ejemplo n.º 13
0
    0xFF,  /* NV_BACKKEY5: KEY=0xFF */
    0xFF,  /* NV_BACKKEY4: KEY=0xFF */
    0xFF,  /* NV_FPROT3: PROT=0xFF */
    0xFF,  /* NV_FPROT2: PROT=0xFF */
    0xFF,  /* NV_FPROT1: PROT=0xFF */
    0xFF,  /* NV_FPROT0: PROT=0xFF */
    0x7E,  /* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 */
    0xFF,  /* NV_FOPT: ??=1,??=1,FAST_INIT=1,LPBOOT1=1,RESET_PIN_CFG=1,
                        NMI_DIS=1,EZPORT_DIS=1,LPBOOT0=1 */
    0xFF,
    0xFF
  };

// ----------------------------------------------------------------------------------
//  Default interrupt handler
void __attribute__((interrupt("IRQ"))) Default_Handler()
{
	while (1)
	{
		__asm("nop");
	}
}

// The register frame pushed onto the stack during exceptions
typedef struct {
    uint32_t r0;
    uint32_t r1;
    uint32_t r2;
    uint32_t r3;
    uint32_t r12;
    uint32_t lr;
Ejemplo n.º 14
0
int main()
{
	char buffer[150];
	char command[50];
	
	char fileName2[50];
	char result[13000];
	char fileName1[25];
	char fileName1Tmp[25];
	char terminateString[3];
	int i, j, c;
	terminateString[0] = 0xd;
	terminateString[1] = 0xa;
	terminateString[2] = '\0';
	


	while(1)
	{

		interrupt(0x21, 0, "Shell:>\0", 0, 0);
		interrupt(0x21, 1, buffer, 0, 0);
		
		
		i = 0; j = 0;
		//read the command from the buffer
		while(buffer[i] != ' ' && buffer[i] != 0xd)
			command[j++] = buffer[i++];
		command[j] = '\0';

		j = 0;
		//make the pointer point to first character of fileName1 in the buffer
		if(buffer[i] == ' ')
			++i;
		//read fileName1 from the buffer
		while(buffer[i] != ' ' && buffer[i] != 0xd)
		{
			fileName1[j] = buffer[i];
			fileName1Tmp[j++] = buffer[i++];

		}
		fileName1[j] = '\0';
		fileName1Tmp[j] = '\0';

		j = 0;
		//make the pointer point to first character of fileName2 in the buffer
		if(buffer[i] == ' ')
			++i;
		//read fileName2 from the buffer
		while(buffer[i] != ' ' && buffer[i] != 0xd)
			fileName2[j++] = buffer[i++];
		fileName2[j] = '\0';
		
		

		//process view command
		if(equal("view\0", command))
		{
			//check if the file name is entered
			if(fileName1[0] == '\0')
			{
				interrupt(0x21, 0, "No file entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			
			interrupt(0x21, 3, fileName1, result, 0);
			//check if the file exists or not
			if(equal("Error!\0", result))
			{
				interrupt(0x21, 0, "File not found", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
			}
			else
			{
				//print the file followed by a new line and carriage return
				interrupt(0x21, 0, result, 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
			}
		}
		//process the execute command
		else if(equal("execute\0", command))
		{
			//check if the file name is entered
			if(fileName1[0] == '\0')
			{
				interrupt(0x21, 0, "No file entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			//read the file to check if file exists or not
			interrupt(0x21, 3, fileName1, result, 0);
			if(equal("Error!\0", result))
			{
				interrupt(0x21, 0, "File not found", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
			}
			else
				interrupt(0x21, 4, fileName1, 0x2000, 0);
			
		}
		//process the delete command
		else if(equal("delete\0", command))
		{
			//check if the file name is entered
			if(fileName1[0] == '\0')
			{
				interrupt(0x21, 0, "No file entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			//read the file to check if the file exists or not
			interrupt(0x21, 3, fileName1, result, 0);
			if(equal("Error!\0", result))
			{
				interrupt(0x21, 0, "File not found", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
			}
			else{
				interrupt(0x21, 7, fileName1, 0, 0);	
			}
		}
		//process the copy command
		else if(equal("copy\0", command))
		{
			//check if the file 1 name is entered
			if(fileName1[0] == '\0')
			{
				interrupt(0x21, 0, "File 1 not entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			//check if the file 2 name is entered
			else if(fileName2[0] == '\0')
			{
				interrupt(0x21, 0, "File 2 not entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			//read the file
			interrupt(0x21, 3, fileName1, result, 0);
			//check if the file exists
			if(equal("Error!\0", result))
			{
				interrupt(0x21, 0, "File not found", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
			}
			else{
				//count the number of sectors
				for(j = 0; result[j] != '\0'; j++);
				j = div(j+511,512);

				interrupt(0x21, 8, fileName2, result, j);	
			}
		}
		//process the dir command
		else if(equal("dir\0", command))
		{
			interrupt(0x21,9,result,0,0);
			interrupt(0x21, 0, result, 0, 0);
			interrupt(0x21, 0, terminateString, 0, 0);

		}
		//process the create command
		else if(equal("create\0", command))
		{
			//check if the file name is entered
			if(fileName1[0] == '\0')
			{
				interrupt(0x21, 0, "No name entered", 0, 0);
				interrupt(0x21, 0, terminateString, 0, 0);
				continue;
			}
			else
			{
				c=0;
				//read the first line into the buffer
				interrupt(0x21, 1, buffer, 0, 0);
				//terminate the loop if the first character in the line is 0xd (carriage return)
				while(buffer[0] != 0xd )
				{
					//copy the buffer into the result
					for (j = 0; buffer[j] != '\0'; ++j)
					{
						result[c++] = buffer[j];
					}
					//read the new line into the buffer
					interrupt(0x21, 1, buffer, 0, 0);
				}
				
				result[c-2] = '\0';
				interrupt(0x21,8,fileName1,result,1);
			}

		}
		else
		{
			//no valid command is entered
			interrupt(0x21, 0, "Bad command", 0, 0);
			interrupt(0x21, 0, terminateString, 0, 0);
		}



	}
}
Ejemplo n.º 15
0
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"

/* Constants required to handle interrupts. */
#define portTIMER_MATCH_ISR_BIT		( ( unsigned portCHAR ) 0x01 )
#define portCLEAR_VIC_INTERRUPT		( ( unsigned portLONG ) 0 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING		( ( unsigned portLONG ) 0 )
volatile unsigned portLONG ulCriticalNesting = 9999UL;

/*-----------------------------------------------------------*/

/* ISR to handle manual context switches (from a call to taskYIELD()). */
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));

/* 
 * The scheduler can only be started from ARM mode, hence the inclusion of this
 * function here.
 */
void vPortISRStartFirstTask( void );
/*-----------------------------------------------------------*/

void vPortISRStartFirstTask( void )
{
	/* Simply start the scheduler.  This is included here as it can only be
	called from ARM mode. */
	portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/
Ejemplo n.º 16
0
int atarisys2_sound_interrupt (void)
{
	return interrupt ();
}
Ejemplo n.º 17
0
Archivo: timer.c Proyecto: hine/MXBasic
    IFS0CLR = _IFS0_T1IF_MASK; // clear interrupt flag

    IPC1bits.T1IP = 2;

    //--- set interval 1ms timer
    T1CON = 0x0010;	// timer(T1), set prescale 1:8
    TMR1 = 0;
    PR1 = GetPeripheralClock()/8/1000L;	// period 1msec
    T1CONSET = _T1CON_TON_MASK;	// start T1
}

/*------------------------------------------------------------------------------
	Timer T1 1msec interval timer.
------------------------------------------------------------------------------*/

void __attribute__ (( interrupt(ipl2), vector(_TIMER_1_VECTOR) )) _T1Interrupt(void)
{
    //extern void disk_timerproc(void);
    unsigned short key;

    // *** down count, etc timer *******************
    // provide timer
    if(AplTimer) AplTimer--;
    if(delay_timer) delay_timer--;

    // disk i/o command timeout timer
    //disk_timerproc();

    // support Display refresh timing
    //if(RefreshTime) RefreshTime--;
Ejemplo n.º 18
0
void readIN(char line[80])
{
	char s[80];
	int i ;
	int flag;
	i = 0;
	// while (line[i] != ' ')
	// {
	// 	s[i] =s[i] + line[i];
	// 	i++;
	// }

	// s[i+1] += '\0';
	// //interrupt(0x21,0,s,0,0);
	// flag = comp(s,"view\0");

	if(line[0] == 'v' && line[1]=='i' && line[2] =='e' && line[3] =='w' && line[4] == ' ')
	{
		char* file;
		char buffer[13312];
		
		file = &line[5];
	
		interrupt(0x21,3,file,buffer,0);
		interrupt(0x21,0,buffer,0,0);
	}
	else
	{

		if(line[0] == 'e' && line[1] == 'x' && line[2] == 'e' && line[3] == 'c' && line[4] == 'u' && line[5] == 't' && line[6] == 'e' && line[7] == ' ')
		{
			char* file;
			file = &line[8];	
			interrupt(0x21,4,file,0x2000,0);
		}
		else 
		{
			if(line[0] == 'd' && line[1] == 'e' && line[2] == 'l' && line[3] == 'e' && line[4] == 't' && line[5] == 'e' && line[6] == ' ')
			{
				char* name;
				name = &line[7];
				interrupt(0x21,7,name,0,0);
			}

			else 
			{
				if(line[0] == 'c' && line[1] == 'o' && line[2] == 'p' && line[3] == 'y' && line[4] == ' ')
				{
					int i;
					int j = 0;
					char* file1;
					char* file2;
					char file1Buffer[13312];
					char* command;

					command = &line[5];
					for(i = 0; command[i] != 0x20;i++)
					{
						file1[i] == command[i];
					}

					for(i = i+1;command[i] != 0x20;i++)
					{
						file2[j] == command[i];
						j++;
					}

					interrupt(0x21,3,file1,file1Buffer,0);


				}

				else 
				{
					interrupt(0x21,0,"Bad command!",0,0);
				}
			}
		}
	}
	
}
Ejemplo n.º 19
0
	void _ISR _T1Interrupt(void)

  Description:
	Updates the tick value when an interrupt occurs.

  Precondition:
	None

  Parameters:
	None

  Returns:
  	None
  ***************************************************************************/
#elif defined(__PIC32MX__)
void __attribute((interrupt(ipl2), vector(_TIMER_1_VECTOR), nomips16)) _T1Interrupt(void)
{
	// Increment internal high tick counter
	dwInternalTicks++;

	// Reset interrupt flag
	IFS0CLR = _IFS0_T1IF_MASK;
}
#else
#if __C30_VERSION__ >= 300
void _ISR __attribute__((__no_auto_psv__)) _T1Interrupt(void)
#else
void _ISR _T1Interrupt(void)
#endif
{
	// Increment internal high tick counter
void endpoint<connection,config>::interrupt(connection_hdl hdl) {
    lib::error_code ec;
    interrupt(hdl,ec);
    if (ec) { throw exception(ec); }
}
Ejemplo n.º 21
0
#define IDISABLE \
		asm volatile ( "LDMFD	SP!, {LR}" 		); /* restore LR */ \
		asm volatile ( "MSR		CPSR_c, #0x92"	); /* disable IRQ */ \
		asm volatile ( "LDMFD	SP!, {LR}"		); /* Restore SPSR_irq to LR */ \
		asm volatile ( "MSR		SPSR_cxsf, LR"	); /* copy LR to SPSR_irq */ \


/* includes */
#include "lpc2103.h"
#include "logger.h"
#include "irq.h"
#include "imu.h"
#include "protocol.h"

/* interruptions */
void __attribute__ ((interrupt("FIQ"))) pulse_in(void);
static void __attribute__ ((interrupt("IRQ"))) protocol_in(void);
static void __attribute__ ((interrupt("IRQ"))) sample(void);
static void __attribute__ ((interrupt("IRQ"))) error(void);

/* init functions */
static inline void PLL_Init(void);
static inline void MAM_Init(void);
static inline void APB_Init(void);

static inline void pulses_in_init(void);
static inline void imu_init(void);
static inline void adc_init(void);
static inline void pwm_out_init(void);
static inline void protocol_init(void);
static inline void sampler_init(void);
Ejemplo n.º 22
0
void EasyTreeWidgetLoader::fillTree(::profiler::timestamp_t& _beginTime, const unsigned int _blocksNumber, const ::profiler::thread_blocks_tree_t& _blocksTree, bool _colorizeRows)
{
    interrupt();
    m_thread = ::std::move(::std::thread(&FillTreeClass<EasyTreeWidgetLoader>::setTreeInternal1, ::std::ref(*this), ::std::ref(m_items), ::std::ref(m_topLevelItems), ::std::ref(_beginTime), _blocksNumber, ::std::ref(_blocksTree), _colorizeRows));
}
Ejemplo n.º 23
0
		if (!snd_clean)
		{
			for (p=pOutput[0]; p<(short *)(pOutput[1]+sound_buffer_size); p++)
				*p=0;

			snd_clean = 1;
		}
	}*/
	Timer++;

	//t3 -= rTCNTO3;
	//profileSND += (int)t3;

}

static void SoundIsr(void) __attribute__ ((interrupt ("IRQ")));
static void SoundIsr (void)
{
        //asm volatile ("stmdb    r13!,{r0-r12,lr}");
        playnextchunk();
	//asm volatile ("ldmia    r13!,{r0-r12,lr}");
        //asm volatile ("subs     pc,lr,#4");
}

void IsrInstall(unsigned long nr,void *ptr)
{
	unsigned int mask;
	gp_disableIRQ();
        //ARMDisableInterrupt();
	mask = 1<<nr;
Ejemplo n.º 24
0
void EasyTreeWidgetLoader::fillTreeBlocks(const::profiler_gui::TreeBlocks& _blocks, ::profiler::timestamp_t _beginTime, ::profiler::timestamp_t _left, ::profiler::timestamp_t _right, bool _strict, bool _colorizeRows)
{
    interrupt();
    m_thread = ::std::move(::std::thread(&FillTreeClass<EasyTreeWidgetLoader>::setTreeInternal2, ::std::ref(*this), ::std::ref(m_items), ::std::ref(m_topLevelItems), _beginTime, ::std::ref(_blocks), _left, _right, _strict, _colorizeRows));
}
Ejemplo n.º 25
0
void ZLXMLReader::setErrorMessage(const std::string &message) {
	myErrorMessage = message;
	interrupt();
}
Ejemplo n.º 26
0
EasyTreeWidgetLoader::~EasyTreeWidgetLoader()
{
    interrupt(true);
}
Ejemplo n.º 27
0
void telrcv(void) {
    register int c;
    static int state = TS_DATA;

    while (ncc > 0) {
	if ((&ptyobuf[BUFSIZ] - pfrontp) < 2) break;
	c = *netip++ & 0377;
	ncc--;

#if defined(ENCRYPT)
	if (decrypt_input) {
	    c = (*decrypt_input)(c);
	}
#endif
	switch (state) {
	 case TS_CR:
	     state = TS_DATA;
	     /* Strip off \n or \0 after a \r */
	     if ((c == 0) || (c == '\n')) {
		 break;
	     }
	     /* FALL THROUGH */

	 case TS_DATA:
	     if (c == IAC) {
		 state = TS_IAC;
		 break;
	     }
	     /*
	      * We now map \r\n ==> \r for pragmatic reasons.
	      * Many client implementations send \r\n when
	      * the user hits the CarriageReturn key.
	      *
	      * We USED to map \r\n ==> \n, since \r\n says
	      * that we want to be in column 1 of the next
	      * printable line, and \n is the standard
	      * unix way of saying that (\r is only good
	      * if CRMOD is set, which it normally is).
	      */
	     if ((c == '\r') && his_state_is_wont(TELOPT_BINARY)) {
#if defined(ENCRYPT)
		 int nc = *netip;
		 if (decrypt_input) {
		     nc = (*decrypt_input)(nc & 0xff);
		 }
#endif
#ifdef	LINEMODE
		 /*
		  * If we are operating in linemode,
		  * convert to local end-of-line.
		  */
		 if (linemode && (ncc > 0) && (('\n' == nc) ||
					       ((0 == nc) && tty_iscrnl())) ) {
		     netip++; ncc--;
		     c = '\n';
		 } 
		 else 
#endif
		 {
#if defined(ENCRYPT)
		     if (decrypt_input)
			 (void)(*decrypt_input)(-1);
#endif
		     state = TS_CR;
		 }
	     }
	     *pfrontp++ = c;
	     break;

	 case TS_IAC:
	 gotiac:
	     switch (c) {
		 
		 /*
		  * Send the process on the pty side an
		  * interrupt.  Do this with a NULL or
		  * interrupt char; depending on the tty mode.
		  */
	      case IP:
		  DIAG(TD_OPTIONS, printoption("td: recv IAC", c));
		  interrupt();
		  break;
	      case BREAK:
		  DIAG(TD_OPTIONS, printoption("td: recv IAC", c));
		  sendbrk();
		  break;
		  
		  /*
		   * Are You There?
		   */
	      case AYT:
		 DIAG(TD_OPTIONS,
		      printoption("td: recv IAC", c));
		  recv_ayt();
		  break;

		  /*
		   * Abort Output
		   */
	      case AO:
		  {
		      static const char msg[] = { IAC, DM };
		      DIAG(TD_OPTIONS, printoption("td: recv IAC", c));
		      ptyflush();	/* half-hearted */
		      init_termbuf();
		      
		      if (slctab[SLC_AO].sptr &&
			  *slctab[SLC_AO].sptr != (cc_t)(_POSIX_VDISABLE)) 
		      {
			  *pfrontp++ =
			      (unsigned char)*slctab[SLC_AO].sptr;
		      }

		      netclear();	/* clear buffer back */
		      sendurg(msg, sizeof(msg));
		      DIAG(TD_OPTIONS, printoption("td: send IAC", DM));
		      break;
		  }

		  /*
		   * Erase Character and
		   * Erase Line
		   */
	      case EC:
	      case EL:
		 {
		     cc_t ch;
		     DIAG(TD_OPTIONS, printoption("td: recv IAC", c));
		     ptyflush();	/* half-hearted */
		     init_termbuf();
		     if (c == EC) ch = *slctab[SLC_EC].sptr;
		     else ch = *slctab[SLC_EL].sptr;
		     if (ch != (cc_t)(_POSIX_VDISABLE))
			 *pfrontp++ = (unsigned char)ch;
		     break;
		 }
		  
		  /*
		   * Check for urgent data...
		   */
	      case DM:
		  DIAG(TD_OPTIONS, printoption("td: recv IAC", c));
		  SYNCHing = stilloob(net);
		  settimer(gotDM);
		  break;
		  
		  /*
		   * Begin option subnegotiation...
		   */
	      case SB:
		  state = TS_SB;
		  SB_CLEAR();
		  continue;

	      case WILL:
		  state = TS_WILL;
		  continue;

	      case WONT:
		  state = TS_WONT;
		  continue;

	      case DO:
		  state = TS_DO;
		  continue;
		  
	      case DONT:
		  state = TS_DONT;
		  continue;

	      case EOR:
		  if (his_state_is_will(TELOPT_EOR)) doeof();
		  break;
		  
		  /*
		   * Handle RFC 10xx Telnet linemode option additions
		   * to command stream (EOF, SUSP, ABORT).
		   */
	      case xEOF:
		  doeof();
		  break;
		  
	      case SUSP:
		  sendsusp();
		  break;

	      case ABORT:
		  sendbrk();
		  break;

	      case IAC:
		 *pfrontp++ = c;
		  break;
	     }
	     state = TS_DATA;
	     break;

	 case TS_SB:
	     if (c == IAC) {
		 state = TS_SE;
	     } 
	     else {
		 SB_ACCUM(c);
	     }
	     break;
	     
	 case TS_SE:
	     if (c != SE) {
		 if (c != IAC) {
				/*
				 * bad form of suboption negotiation.
				 * handle it in such a way as to avoid
				 * damage to local state.  Parse
				 * suboption buffer found so far,
				 * then treat remaining stream as
				 * another command sequence.
				 */
		     
				/* for DIAGNOSTICS */
		     SB_ACCUM(IAC);
		     SB_ACCUM(c);
		     subpointer -= 2;
		     
		     SB_TERM();
		     suboption();
		     state = TS_IAC;
		     goto gotiac;
		 }
		 SB_ACCUM(c);
		 state = TS_SB;
	     }
	     else {
		 /* for DIAGNOSTICS */
		 SB_ACCUM(IAC);
		 SB_ACCUM(SE);
		 subpointer -= 2;
		 
		 SB_TERM();
		 suboption();	/* handle sub-option */
		 state = TS_DATA;
	     }
	     break;
	     
	 case TS_WILL:
	     willoption(c);
	     state = TS_DATA;
	     continue;

	 case TS_WONT:
	     wontoption(c);
	     state = TS_DATA;
	     continue;

	 case TS_DO:
	     dooption(c);
	     state = TS_DATA;
	     continue;
	     
	 case TS_DONT:
	     dontoption(c);
	     state = TS_DATA;
	     continue;
	     
	 default:
	     syslog(LOG_ERR, "telnetd: panic state=%d\n", state);
	     printf("telnetd: panic state=%d\n", state);
	     exit(1);
	}
    }
}
Ejemplo n.º 28
0
            CheKseg0CacheOn();

            INTEnableSystemMultiVectoredInt();

            value = OSCCON;
            while (!(value & 0x00000020))
            {
                value = OSCCON;    // Wait for PLL lock to stabilize
            }

            //Disable JTAG
            DDPCONbits.JTAGEN = 0;

            LED_Enable(LED_USB_DEVICE_STATE);
            BUTTON_Enable(BUTTON_USB_DEVICE_HID_MOUSE);
            break;
            
        default:
            break;
    }
}

#warning "TODO: document"
#if defined(USB_INTERRUPT)
void __attribute__((interrupt(),vector(_USB_1_VECTOR))) _USB1Interrupt( void )
{
    USBDeviceTasks();
}
#endif

/*
 * The task that is periodically triggered by an interrupt, as described at the
 * top of this file.
 */
static void prvISRTriggeredTask( void* pvParameters );

/*
 * Configures the T5 timer peripheral to generate the interrupts that unblock
 * the task implemented by the prvISRTriggeredTask() function.
 */
static void prvSetupT5( void );

/* The timer 5 interrupt handler.  As this interrupt uses the FreeRTOS assembly
entry point the IPL setting in the following function prototype has no effect. */
void __attribute__( (interrupt(ipl3), vector(_TIMER_5_VECTOR))) vT5InterruptWrapper( void );

/*-----------------------------------------------------------*/

/* The semaphore given by the T5 interrupt to unblock the task implemented by
 the prvISRTriggeredTask() function. */
static xSemaphoreHandle xBlockSemaphore = NULL;
/*-----------------------------------------------------------*/

void vStartISRTriggeredTask( void )
{
	/* Create the task described at the top of this file.  The timer is
	configured by the task itself. */
	xTaskCreate( prvISRTriggeredTask, 					/* The function that implements the task. */
				( const signed char * const ) "ISRt", 	/* Text name to help debugging - not used by the kernel. */
				configMINIMAL_STACK_SIZE, 				/* The size of the stack to allocate to the task - defined in words, not bytes. */
Ejemplo n.º 30
0
int galaga_interrupt_2(void)
{
	if (interrupt_enable_2) return interrupt();
	else return ignore_interrupt();
}