本文整理汇总了C#中System.Machine.ObtainClockSource方法的典型用法代码示例。如果您正苦于以下问题:C# Machine.ObtainClockSource方法的具体用法?C# Machine.ObtainClockSource怎么用?C# Machine.ObtainClockSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Machine
的用法示例。
在下文中一共展示了Machine.ObtainClockSource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TegraTimer
public TegraTimer(Machine machine)
{
IRQ = new GPIO();
sync = new object();
clockSource = machine.ObtainClockSource();
Reset();
}
示例2: ComparingTimer
public ComparingTimer(Machine machine, long frequency, long compare, long limit)
{
if(compare > limit || compare < 0)
{
throw new ConstructionException(string.Format(CompareHigherThanLimitMessage, compare, limit));
}
this.limit = limit;
initialCompare = compare;
clockSource = machine.ObtainClockSource();
clockSource.AddClockEntry(new ClockEntry(compare, ClockEntry.FrequencyToRatio(this, frequency), CompareReached, false, workMode: WorkMode.OneShot));
}
示例3: LimitTimer
public LimitTimer(Machine machine, long frequency, long limit = int.MaxValue, Direction direction = Direction.Descending, bool enabled = false, WorkMode workMode = WorkMode.Periodic)
{
if(limit == 0)
{
throw new ArgumentException("Limit cannot be zero.");
}
irqSync = new object();
clockSource = machine.ObtainClockSource();
initialFrequency = frequency;
initialLimit = limit;
initialDirection = direction;
initialEnabled = enabled;
initialWorkMode = workMode;
InternalReset();
}
示例4: SimpleTicker
public SimpleTicker(long periodInMs, Machine machine)
{
var clockSource = machine.ObtainClockSource();
clockSource.AddClockEntry(new ClockEntry(periodInMs, ClockEntry.FrequencyToRatio(this, 1000), OnTick));
}
示例5: PowerPc
public PowerPc(string cpuType, Machine machine, EndiannessEnum endianness = EndiannessEnum.BigEndian): base(cpuType, machine, endianness)
{
irqSync = new object();
machine.ObtainClockSource().AddClockEntry(
new ClockEntry(long.MaxValue/2, ClockEntry.FrequencyToRatio(this, 128000000), DecrementerHandler, false, Direction.Descending));
}