Esempio n. 1
0
        public DataCollectorRadarSD()
        {
            Debug.Print("Initializing LCD ....");
            lcd = new Samraksh.SPOT.Hardware.EmoteDotNow.EmoteLCD();
            lcd.Initialize();
            lcd.Clear();


            Debug.Print("Initializing ADC .....");

            channelIBuffer = new BufferStorage(bufferSize);
            channelQBuffer = new BufferStorage(bufferSize);

            adcCallbackPtr = AdcCallbackFn;
            Samraksh.SPOT.Hardware.EmoteDotNow.AnalogInput.InitializeADC();
            Samraksh.SPOT.Hardware.EmoteDotNow.AnalogInput.InitChannel(Samraksh.SPOT.Hardware.EmoteDotNow.ADCChannel.ADC_Channel1);
            Samraksh.SPOT.Hardware.EmoteDotNow.AnalogInput.InitChannel(Samraksh.SPOT.Hardware.EmoteDotNow.ADCChannel.ADC_Channel2);
            if (!Samraksh.SPOT.Hardware.EmoteDotNow.AnalogInput.ConfigureContinuousModeDualChannel(sampleBuffer1, sampleBuffer2, bufferSize, sampleTime, AdcCallbackFn))
            {
                throw new InvalidOperationException("ADC Initialization failed \n");
            }

            Debug.Print("Initializing NOR ...");
            lcd.Write(Samraksh.SPOT.Hardware.EmoteDotNow.LCD.CHAR_E, Samraksh.SPOT.Hardware.EmoteDotNow.LCD.CHAR_R, Samraksh.SPOT.Hardware.EmoteDotNow.LCD.CHAR_A, Samraksh.SPOT.Hardware.EmoteDotNow.LCD.CHAR_S);
            storage = new NorStore();

            Debug.Print("Initializing SD ...");
            removableStorage = new SDStore();
        }
Esempio n. 2
0
        public bool Persist(PersistentStorage storage)
        {
            lock (bufferLock)
            {
                if (!storage.Write(buffer, (ushort)buffer.Length))
                {
                    return(false);
                }

                bufferfull = false;
            }

            return(true);
        }