#ifndef __TISRW_H__
#define __TISRW_H__

#include "kernel.h"
#include "target.h"

class TISRW
{
	public:
		  TISRW()  { ISR_Enter(); }
		  ~TISRW() { ISR_Exit();  }

	private:

		 void ISR_Enter() {
			CriticalSection cs;
			Kernel::_ISR_NestCount++;
		}

		 void ISR_Exit() {
			 CriticalSection cs;
			if (--Kernel::_ISR_NestCount)
				return;
			Kernel::SchedISR();
		}
};

#endif // __TISRW_H__
