Update src/boot.lua
This commit is contained in:
		
							parent
							
								
									4d95562f84
								
							
						
					
					
						commit
						34fe5021a3
					
				
							
								
								
									
										23
									
								
								src/boot.lua
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								src/boot.lua
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,29 @@
 | 
			
		|||
-- keycardOS "bootloader", has no access to basalt
 | 
			
		||||
-- intended for checking for updates, and automatically updating basalt if it is missing
 | 
			
		||||
 | 
			
		||||
LAST_USED = os.time()
 | 
			
		||||
 | 
			
		||||
local function checkForUpdate()
 | 
			
		||||
    current_time = os.time()
 | 
			
		||||
    difference = math.abs(current_time - LAST_USED)
 | 
			
		||||
    print("Checking for update... difference: " .. tostring(difference))
 | 
			
		||||
    --its been considerable time since the keypad was interacted with, therefore it's time to force an update down the users throat (microsoft moment)
 | 
			
		||||
    if difference > .5 then
 | 
			
		||||
 | 
			
		||||
        --logic for updating
 | 
			
		||||
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function updateChecker()
 | 
			
		||||
 | 
			
		||||
    while true do
 | 
			
		||||
        checkForUpdate()
 | 
			
		||||
        sleep(1)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function boot()
 | 
			
		||||
    KEYPADOS_VERSION = "3.0"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user