001package com.ctre.phoenix.motorcontrol; 002 003import com.ctre.phoenix.unmanaged.Unmanaged; 004 005import edu.wpi.first.hal.simulation.SimulatorJNI; 006import edu.wpi.first.hal.HAL; 007import edu.wpi.first.hal.HAL.SimPeriodicBeforeCallback; 008import edu.wpi.first.wpilibj.DriverStation; 009 010public class WPI_AutoFeedEnable { 011 private static WPI_AutoFeedEnable autoFeedEnable = new WPI_AutoFeedEnable(); 012 private SimPeriodicBeforeCallback simPeriodicCallback; 013 014 public static WPI_AutoFeedEnable getInstance() { 015 return autoFeedEnable; 016 } 017 018 private WPI_AutoFeedEnable() { 019 simPeriodicCallback = HAL.registerSimPeriodicBeforeCallback(() -> { 020 if (DriverStation.getInstance().isEnabled()) { 021 Unmanaged.feedEnable(100); 022 } 023 }); 024 } 025}