<commit_before>import os

import wiringpi

import config

disklogging = True
touchdevice = True
GoDim = None
GoBright = None

# This version of hw uses the real hw pwm for screen dimming - much better appearance


def initOS(screentype):
	global GoDim, GoBright
	if screentype == 'pi7':
		os.environ['SDL_FBDEV'] = '/dev/fb0'
		os.environ['SDL_NOMOUSE'] = '1'
		os.environ['SDL_MOUSEDEV'] = ''
		os.environ['SDL_MOUSEDRV'] = ''
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
		GoDim = GoDimPi7
		GoBright = GoDimPi7
	elif screentype == '35r':
		os.environ['SDL_FBDEV'] = '/dev/fb1'
		os.environ['SDL_NOMOUSE'] = '1'
		os.environ['SDL_MOUSEDEV'] = ''
		os.environ['SDL_MOUSEDRV'] = ''
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
	else:
		os.environ['SDL_FBDEV'] = '/dev/fb1'
		os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'
		os.environ['SDL_MOUSEDRV'] = 'TSLIB'
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
		try:
			# if this system has the newer screen control then turn off the SMTPE control so PWM works
			with open('/sys/class/backlight/soc:backlight/brightness', 'w') as f:
				f.write('0')
		except:
			pass<commit_msg>Turn off SDL touch handling for 35r<commit_after>import os

import wiringpi

import config

disklogging = True
touchdevice = True
GoDim = None
GoBright = None

# This version of hw uses the real hw pwm for screen dimming - much better appearance


def initOS(screentype):
	global GoDim, GoBright
	if screentype == 'pi7':
		os.environ['SDL_FBDEV'] = '/dev/fb0'
		os.environ['SDL_NOMOUSE'] = '1'
		os.environ['SDL_MOUSEDEV'] = ''
		os.environ['SDL_MOUSEDRV'] = ''
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
		GoDim = GoDimPi7
		GoBright = GoDimPi7
	elif screentype == '35r':
		os.environ['SDL_FBDEV'] = '/dev/fb1'
		os.environ['SDL_NOMOUSE'] = '1'
		os.environ['SDL_MOUSEDEV'] = ''
		os.environ['SDL_MOUSEDRV'] = ''
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
		try:
			# if this system has the newer screen control then turn off the SMTPE control so PWM works
			with open('/sys/class/backlight/soc:backlight/brightness', 'w') as f:
				f.write('0')
		except:
			pass

		wiringpi.wiringPiSetupGpio()
		wiringpi.pinMode(18, 2)
		wiringpi.pwmSetMode(wiringpi.PWM_MODE_MS)  # default balanced mode makes screen dark at about 853/1024
		wiringpi.pwmWrite(18, 1024)
		GoDim = GoDimPWM
	else:
		os.environ['SDL_FBDEV'] = '/dev/fb1'
		os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'
		os.environ['SDL_MOUSEDRV'] = 'TSLIB'
		os.environ['SDL_VIDEODRIVER'] = 'fbcon'
		try:
			# if this system has the newer screen control then turn off the SMTPE control so PWM works
			with open('/sys/class/backlight/soc:backlight/brightness', 'w') as f:
				f.write('0')
		except:
			pass
{'fraction_non_alphanumeric': 0.14046822742474915, 'fraction_numerical': 0.015235971757710888, 'mean_word_length': 4.196911196911197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7256402', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1071, 'n_words': 238}