Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit941a164

Browse files
committed
Fixes a few things.
1 parentf2740c1 commit941a164

File tree

6 files changed

+73
-122
lines changed

6 files changed

+73
-122
lines changed

‎builder/esp32.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,46 @@ def submodules():
378378
defcompile():# NOQA
379379
env=setup_idf_environ()
380380

381+
ifboardin ('ESP32_GENERIC_S2','ESP32_GENERIC_S3'):
382+
383+
mphalport_path='lib/micropython/ports/esp32/mphalport.c'
384+
385+
withopen(mphalport_path,'rb')asf:
386+
data=f.read().decode('utf-8')
387+
388+
data=data.replace('#elif CONFIG_USB_OTG_SUPPORTED','#elif MP_USB_OTG')
389+
390+
withopen(mphalport_path,'wb')asf:
391+
f.write(data.encode('utf-8'))
392+
393+
main_path='lib/micropython/ports/esp32/main.c'
394+
395+
withopen(main_path,'rb')asf:
396+
data=f.read().decode('utf-8')
397+
398+
data=data.replace(
399+
'#elif CONFIG_USB_OTG_SUPPORTED',
400+
'#elif MP_USB_OTG'
401+
)
402+
403+
withopen(main_path,'wb')asf:
404+
f.write(data.encode('utf-8'))
405+
406+
mpconfigboard_path=f'lib/micropython/ports/esp32/boards/{board}/mpconfigboard.h'
407+
withopen(mpconfigboard_path,'rb')asf:
408+
data=f.read().decode('utf-8')
409+
410+
if'MP_USB_OTG'notindata:
411+
data+= (
412+
'\n'
413+
'#ifndef MP_USB_OTG\n'
414+
'#define MP_USB_OTG (0)\n'
415+
'#endif'
416+
)
417+
418+
withopen(mpconfigboard_path,'wb')asf:
419+
f.write(data.encode('utf-8'))
420+
381421
mpconfigport_path='lib/micropython/ports/esp32/mpconfigport.h'
382422

383423
withopen(mpconfigport_path,'rb')asf:

‎driver/indev/ft5x06.py‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
frommicropythonimportconst
22
importpointer_framework
3-
importi2cas_i2c
43

54
_DEV_MODE=const(0x00)
65
_GEST_ID=const(0x01)
@@ -46,30 +45,33 @@ def _i2c_write8(self, register_addr, data):
4645
self._buf[0]=data
4746
self._i2c.write_mem(register_addr,self._mv[:1])
4847

49-
def__init__(self,bus,touch_cal=None):# NOQA
48+
def__init__(self,i2c_bus,touch_cal=None):# NOQA
5049
self._buf=bytearray(5)
5150
self._mv=memoryview(self._buf)
52-
self._i2c=_i2c.I2CDevice(bus,_I2C_SLAVE_ADDR)
5351

54-
data=self._i2c_read8(_PANEL_ID_REG)
55-
print("Device ID: 0x%02x"%data)
56-
ifdata!=_VENDID:
57-
raiseRuntimeError()
52+
self._i2c_bus=i2c_bus
53+
self._i2c=i2c_bus.add_device(_I2C_SLAVE_ADDR,8)
5854

59-
data=self._i2c_read8(_CHIPID_REG)
60-
print("ChipID: 0x%02x"%data)
55+
venid=self._i2c_read8(_PANEL_ID_REG)
56+
print("Touch DeviceID: 0x%02x"%venid)
6157

62-
ifdatanotin (_FT5x06_CHIPID,):
63-
raiseRuntimeError()
58+
chipid=self._i2c_read8(_CHIPID_REG)
59+
print("Touch Chip ID: 0x%02x"%chipid)
6460

6561
data=self._i2c_read8(_DEV_MODE_REG)
66-
print("Device mode: 0x%02x"%data)
62+
print("TouchDevice mode: 0x%02x"%data)
6763

6864
data=self._i2c_read8(_FIRMWARE_ID_REG)
69-
print("Firmware ID: 0x%02x"%data)
65+
print("TouchFirmware ID: 0x%02x"%data)
7066

7167
data=self._i2c_read8(_RELEASECODE_REG)
72-
print("Release code: 0x%02x"%data)
68+
print("Touch Release code: 0x%02x"%data)
69+
70+
ifchipidnotin (_FT5x06_CHIPID,):
71+
raiseRuntimeError()
72+
73+
ifvenid!=_VENDID:
74+
raiseRuntimeError()
7375

7476
self._i2c_write8(_DEV_MODE_REG,_DEV_MODE_WORKING)
7577
self._i2c_write8(_PERIOD_ACTIVE_REG,0x0E)

‎driver/indev/ft5x16.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
frommicropythonimportconst
22
importpointer_framework
3-
importi2cas_i2c
43

54
_DEV_MODE=const(0x00)
65
_GEST_ID=const(0x01)
@@ -46,10 +45,12 @@ def _i2c_write8(self, register_addr, data):
4645
self._buf[0]=data
4746
self._i2c.write_mem(register_addr,self._mv[:1])
4847

49-
def__init__(self,bus,touch_cal=None):# NOQA
48+
def__init__(self,i2c_bus,touch_cal=None):# NOQA
5049
self._buf=bytearray(5)
5150
self._mv=memoryview(self._buf)
52-
self._i2c=_i2c.I2CDevice(bus,_I2C_SLAVE_ADDR)
51+
52+
self._i2c_bus=i2c_bus
53+
self._i2c=i2c_bus.add_device(_I2C_SLAVE_ADDR,8)
5354

5455
data=self._i2c_read8(_PANEL_ID_REG)
5556
print("Device ID: 0x%02x"%data)

‎driver/indev/ft6x06.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
frommicropythonimportconst
22
importpointer_framework
3-
importi2cas_i2c
43

54
_DEV_MODE=const(0x00)
65
_GEST_ID=const(0x01)
@@ -46,10 +45,12 @@ def _i2c_write8(self, register_addr, data):
4645
self._buf[0]=data
4746
self._i2c.write_mem(register_addr,self._mv[:1])
4847

49-
def__init__(self,bus,touch_cal=None):# NOQA
48+
def__init__(self,i2c_bus,touch_cal=None):# NOQA
5049
self._buf=bytearray(5)
5150
self._mv=memoryview(self._buf)
52-
self._i2c=_i2c.I2CDevice(bus,_I2C_SLAVE_ADDR)
51+
52+
self._i2c_bus=i2c_bus
53+
self._i2c=i2c_bus.add_device(_I2C_SLAVE_ADDR,8)
5354

5455
data=self._i2c_read8(_PANEL_ID_REG)
5556
print("Device ID: 0x%02x"%data)

‎driver/indev/ft6x36.py‎

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
frommicropythonimportconst
22
importpointer_framework
3-
importi2cas_i2c
43

54
# FT3267
65
# FT5336GQQ
@@ -10,98 +9,6 @@
109
# FT5x26
1110
# ft5302
1211

13-
1.143
14-
15-
'''
16-
18.8%
17-
11.9%
18-
19-
20-
3,378.80
21-
22-
3,432.80
23-
24-
In 2022 Jefferson County employees receive an
25-
additional average amount of 34.64 % of such
26-
compensation for fringe benefits.
27-
28-
2022 saleries: 225,425,700
29-
2022 benifits: 65,571,000
30-
That comes out to 29.0% in fringe benifits 2022, so where is the other 5.64%??
31-
5.64% is 12,714,009.48 dollars
32-
33-
in 2022 there were 3,335 employees and in 2024 there is 3,432.80. 97 more positions now than there was in 2022.
34-
2022 saleries and benifits cost 290,996,700 and in 2024 the cost is 350,283,700, That's a difference of 59,287,000 dollars.
35-
there are 54 new positions from 2023 to 2024 but there is an increase of saleries of 18.8%. 18.8% in a single year!!!!!...
36-
That's a difference of 42,022,900 dollars!!. somehow I don't think the 54 new employees are each making 778,201 dollars a year.
37-
38-
39-
42,022,900
40-
41-
42-
290,996,700
43-
44-
45-
50,087,000
46-
47-
341,083,700
48-
31.6% in 2024
49-
Libraries
50-
51-
This is being spent from the general fund
52-
8.4 million for Library buildings
53-
8.7 million for the South Jefferson County Library
54-
5.8 million to continue the South Library
55-
22.9 million total
56-
57-
Here are the budgets for the last few years
58-
59-
2021 $37,716,700
60-
2022 $39,485,300
61-
2023 $91,877,700
62-
2024 $66,042,300
63-
64-
65-
Expendatures
66-
Salaries: 25,014,600 (312.00 jobs)
67-
Supplies: 7,590,700
68-
Other 6,590,700
69-
Capital Outlay (buying books and movies): 23,044,800
70-
71-
Expendatures where the money goes out without the money being used for the Libraries
72-
Intergovernmental: 0.00
73-
Interdepartmental: 3,801,500
74-
75-
I want to note that Jefferson County has 11 Libraries.
76-
2024 has 14 new positions for the library
77-
78-
79-
80-
Road and Bridge
81-
82-
$16.8 million for roadway projects
83-
84-
Here are the budgets for the last few years
85-
86-
2021 $46,724,700
87-
2022 $48,976,000
88-
2023 $66,797,600
89-
2024 $58,092,900
90-
91-
Expendatures
92-
93-
Salaries: 15,482,200 (186 employees)
94-
Supplies: 4,037,800
95-
Other: 9,035,400
96-
Capital Outlay: 13,635,000
97-
98-
Expendatures where the money goes out without the money being used for the roads and bridges
99-
Intergovernmental: 4,048,100
100-
Interdepartmental 11,854,400
101-
102-
103-
'''
104-
10512
_I2C_SLAVE_ADDR=const(0x38)
10613

10714
# Register of the current mode
@@ -144,10 +51,12 @@ def _i2c_write8(self, register_addr, data):
14451
self._buf[0]=data
14552
self._i2c.write_mem(register_addr,self._mv[:1])
14653

147-
def__init__(self,bus,touch_cal=None):# NOQA
54+
def__init__(self,i2c_bus,touch_cal=None):# NOQA
14855
self._buf=bytearray(5)
14956
self._mv=memoryview(self._buf)
150-
self._i2c=_i2c.I2CDevice(bus,_I2C_SLAVE_ADDR)
57+
58+
self._i2c_bus=i2c_bus
59+
self._i2c=i2c_bus.add_device(_I2C_SLAVE_ADDR,8)
15160

15261
data=self._i2c_read8(_PANEL_ID_REG)
15362
print("Device ID: 0x%02x"%data)

‎driver/indev/gt911.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ def __init__(self, i2c_bus, reset_pin=None, interrupt_pin=None, touch_cal=None):
7676
# self.touch_reset()
7777

7878
self._i2c.read_mem(_PRODUCT_ID_REG,buf=self._mv[:4])
79-
print('Product id:',self._buf[:4])
79+
print('TouchProduct id:',self._buf[:4])
8080

8181
self._i2c.read_mem(_FIRMWARE_VERSION_REG,buf=self._mv[:2])
82-
print('Firmware version:',hex(self._buf[0]+ (self._buf[1]<<8)))
82+
print('TouchFirmware version:',hex(self._buf[0]+ (self._buf[1]<<8)))
8383

8484
self._i2c.read_mem(_VENDOR_ID_REG,buf=self._mv[:1])
85-
print('Vendor id:',hex(self._buf[0]))
85+
print('TouchVendor id:',hex(self._buf[0]))
8686

8787
self._i2c.read_mem(_X_CORD_RES_REG,buf=self._mv[:2])
88-
print('Configured width:',self._buf[0]+ (self._buf[1]<<8))
88+
print('TouchConfigured width:',self._buf[0]+ (self._buf[1]<<8))
8989

9090
self._i2c.read_mem(_Y_CORD_RES_REG,buf=self._mv[:2])
91-
print('Configured height:',self._buf[0]+ (self._buf[1]<<8))
91+
print('TouochConfigured height:',self._buf[0]+ (self._buf[1]<<8))
9292

9393
self._buf[0]=0x00
9494
self._i2c.write_mem(_ESD_CHECK_REG,buf=self._mv[:1])
@@ -159,8 +159,6 @@ def _get_coords(self):
159159
x=self._buf[0]+ (self._buf[1]<<8)
160160
y=self._buf[2]+ (self._buf[3]<<8)
161161

162-
print(x,y)
163-
164162
self._buf[0]=0x00
165163
self._i2c.write_mem(_STATUS_REG,buf=self._mv[:1])
166164

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp