Esempio n. 1
0
        /// <summary>
        /// Configures the application from the 'resources.txt' file place on the microSD card.
        /// See the 'SD Card Resources' folder for a sample to start with.
        /// </summary>
        private static void InitializeResources()
        {
            var resourceLoader = new SDResourceLoader();

            try {
                resourceLoader.Load();
            } catch (IOException e) {
                PowerState.RebootDevice(false);
            }

            _key        = (string)resourceLoader.Strings["key"];
            _user       = (string)resourceLoader.Strings["user"];
            _host       = (string)resourceLoader.Strings["host"];
            _port       = int.Parse((string)resourceLoader.Strings["port"]);
            _timeZone   = int.Parse((string)resourceLoader.Strings["timeZone"]);
            _ntpServers = (string)resourceLoader.Strings["ntpServers"];
            _dst        = int.Parse((string)resourceLoader.Strings["dst"]);

            resourceLoader.Dispose();

            vm            = new VirtualFrame(40960, 16, VirtualMemoryFilename);
            vm.IsReadOnly = false;

            tft             = new AdaFruitST7735(Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D8, speedKHz: 40000, vm: vm);
            tft.Orientation = AdaFruitST7735.ScreenOrientation.Landscape;

            Debug.GC(true);
        }