pyalamake 2.3.1__tar.gz → 2.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {pyalamake-2.3.1/src/pyalamake.egg-info → pyalamake-2.3.2}/PKG-INFO +1 -1
  2. {pyalamake-2.3.1 → pyalamake-2.3.2}/pyproject.toml +1 -1
  3. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/constants_version.py +1 -1
  4. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_arduino.py +91 -8
  5. {pyalamake-2.3.1 → pyalamake-2.3.2/src/pyalamake.egg-info}/PKG-INFO +1 -1
  6. {pyalamake-2.3.1 → pyalamake-2.3.2}/LICENSE.txt +0 -0
  7. {pyalamake-2.3.1 → pyalamake-2.3.2}/MANIFEST.in +0 -0
  8. {pyalamake-2.3.1 → pyalamake-2.3.2}/README.md +0 -0
  9. {pyalamake-2.3.1 → pyalamake-2.3.2}/setup.cfg +0 -0
  10. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/__init__.py +0 -0
  11. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/arduino_shared.py +0 -0
  12. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/boards.json +0 -0
  13. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/compile_cmd_json.py +0 -0
  14. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/gbl.py +0 -0
  15. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/list_param.py +0 -0
  16. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/makefile_variables.py +0 -0
  17. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/osal.py +0 -0
  18. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/package_cpip.py +0 -0
  19. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/package_opengl.py +0 -0
  20. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/path_handle.py +0 -0
  21. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/pyalamake.py +0 -0
  22. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/svc.py +0 -0
  23. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_arduino_core.py +0 -0
  24. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_base.py +0 -0
  25. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_base_min.py +0 -0
  26. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_c.py +0 -0
  27. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_c_cpp_base.py +0 -0
  28. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_c_cpp_lib_base.py +0 -0
  29. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_c_lib.py +0 -0
  30. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_cpp.py +0 -0
  31. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_cpp_lib.py +0 -0
  32. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_gtest.py +0 -0
  33. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_manual.py +0 -0
  34. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake/target_swig.py +0 -0
  35. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake.egg-info/SOURCES.txt +0 -0
  36. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake.egg-info/dependency_links.txt +0 -0
  37. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake.egg-info/requires.txt +0 -0
  38. {pyalamake-2.3.1 → pyalamake-2.3.2}/src/pyalamake.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyalamake
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: python module to generate Makefiles for arduino, GTest, C/C++, etc.
5
5
  Author-email: "J. Arrizza" <cppgent0@gmail.com>
6
6
  Maintainer-email: "J. Arrizza" <cppgent0@gmail.com>
@@ -19,7 +19,7 @@ dependencies = [
19
19
 
20
20
  # common values
21
21
  name = 'pyalamake'
22
- version = '2.3.1'
22
+ version = '2.3.2'
23
23
  requires-python = '>=3.9'
24
24
  authors = [{ name = 'J. Arrizza', email = 'cppgent0@gmail.com' }]
25
25
  maintainers = [
@@ -6,4 +6,4 @@ from dataclasses import dataclass
6
6
  @dataclass
7
7
  class ConstantsVersion:
8
8
  ## current App version
9
- version = '2.3.1'
9
+ version = '2.3.2'
@@ -78,16 +78,99 @@ class TargetArduino(TargetBase):
78
78
  # @param lib the library to add
79
79
  # @return None
80
80
  def add_library(self, lib):
81
- if lib == 'Servo':
82
- svc.log.line(f'adding arduino library: {lib}')
83
- path = PathHandle(f'{self._shared.library_root}/Servo/src')
84
- self._check_library_installed(path, lib)
85
- self.add_sources(f'{path.fixed}/avr/Servo.cpp') # pylint: disable=E1101
86
- self.add_include_directories(path.fixed) # pylint: disable=E1101
87
- self.add_compile_options('-DARDUINO_ARCH_AVR') # pylint: disable=E1101
88
- else:
81
+ # TODO use these:
82
+ # libraries: arduino-cli lib list "Adafruit Motor Shield V2 Library" --format json
83
+ # packages : arduino-cli lib list "Wire" -b arduino:avr:uno --format json
84
+ # dependcies: arduino-cli lib deps "Adafruit Motor Shield V2 Library"
85
+
86
+ valid_libs = {
87
+ 'Servo': self._add_lib_servo,
88
+ 'AdafruitMotorShieldV2': self._add_lib_motorshield_v2,
89
+ 'AdafruitBusIO': self._add_lib_busio,
90
+ # packages
91
+ 'Wire': self._add_pkg_wire,
92
+ 'SPI': self._add_pkg_spi,
93
+ }
94
+ if lib not in valid_libs:
89
95
  svc.abort(f'{self.target} target_arduino: unknown arduino library: {lib}')
90
96
 
97
+ svc.log.line(f'adding arduino library: {lib}')
98
+ valid_libs[lib](lib)
99
+
100
+ self.add_compile_options('-DARDUINO_ARCH_AVR') # pylint: disable=E1101
101
+
102
+ # --------------------
103
+ ## add Servo files
104
+ # @param lib the library to add
105
+ # @return None
106
+ def _add_lib_servo(self, lib):
107
+ path = PathHandle(f'{self._shared.library_root}/Servo/src')
108
+ self._check_library_installed(path, lib)
109
+ self.add_sources(f'{path.fixed}/avr/Servo.cpp') # pylint: disable=E1101
110
+ self.add_include_directories(path.fixed) # pylint: disable=E1101
111
+
112
+ # --------------------
113
+ ## add Adafruit Motor Shield V2 files
114
+ # @param lib the library to add
115
+ # @return None
116
+ def _add_lib_motorshield_v2(self, lib):
117
+ path = PathHandle(f'{self._shared.library_root}/Adafruit_Motor_Shield_V2_Library')
118
+ self._check_library_installed(path, lib)
119
+ self.add_sources(
120
+ [
121
+ f'{path.fixed}/Adafruit_MotorShield.cpp',
122
+ f'{path.fixed}/utility/Adafruit_MS_PWMServoDriver.cpp',
123
+ ]
124
+ ) # pylint: disable=E1101
125
+ self.add_include_directories(
126
+ [
127
+ path.fixed,
128
+ f'{path.fixed}/utility',
129
+ ]
130
+ ) # pylint: disable=E1101
131
+
132
+ # --------------------
133
+ ## add Adafruit Bus IO files
134
+ # @param lib the library to add
135
+ # @return None
136
+ def _add_lib_busio(self, lib):
137
+ path = PathHandle(f'{self._shared.library_root}/Adafruit_BusIO')
138
+ self._check_library_installed(path, lib)
139
+ self.add_sources(
140
+ [
141
+ f'{path.fixed}/Adafruit_BusIO_Register.cpp',
142
+ f'{path.fixed}/Adafruit_GenericDevice.cpp',
143
+ f'{path.fixed}/Adafruit_I2CDevice.cpp',
144
+ f'{path.fixed}/Adafruit_SPIDevice.cpp',
145
+ ]
146
+ ) # pylint: disable=E1101
147
+ self.add_include_directories(path.fixed) # pylint: disable=E1101
148
+
149
+ # --------------------
150
+ ## add Wire package files
151
+ # @param _lib unused
152
+ # @return None
153
+ def _add_pkg_wire(self, _lib):
154
+ path = PathHandle(f'{svc.osal.arduino_root_dir()}/packages/arduino/hardware/avr/1.8.7/libraries/Wire/src')
155
+ # built-in package, no installation
156
+ self.add_sources(
157
+ [
158
+ f'{path.fixed}/Wire.cpp',
159
+ f'{path.fixed}/utility/twi.c',
160
+ ]
161
+ )
162
+ self.add_include_directories([path.fixed, f'{path.fixed}/utility']) # pylint: disable=E1101
163
+
164
+ # --------------------
165
+ ## add SPI package files
166
+ # @param _lib unused
167
+ # @return None
168
+ def _add_pkg_spi(self, _lib):
169
+ path = PathHandle(f'{svc.osal.arduino_root_dir()}/packages/arduino/hardware/avr/1.8.7/libraries/SPI/src')
170
+ # built-in package, no installation
171
+ self.add_sources(f'{path.fixed}/SPI.cpp')
172
+ self.add_include_directories(path.fixed) # pylint: disable=E1101
173
+
91
174
  # --------------------
92
175
  ## check if an arduino library is installed
93
176
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyalamake
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: python module to generate Makefiles for arduino, GTest, C/C++, etc.
5
5
  Author-email: "J. Arrizza" <cppgent0@gmail.com>
6
6
  Maintainer-email: "J. Arrizza" <cppgent0@gmail.com>
File without changes
File without changes
File without changes
File without changes