Keyboard firmwares for Atmel AVR and Cortex-M
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ds5_5.py 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. """
  2. mbed SDK
  3. Copyright (c) 2011-2013 ARM Limited
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. """
  14. from exporters import Exporter
  15. from os.path import basename
  16. class DS5_5(Exporter):
  17. NAME = 'DS5'
  18. TARGETS = [
  19. 'LPC1768',
  20. 'LPC11U24',
  21. 'LPC812',
  22. 'UBLOX_C027',
  23. 'ARCH_PRO',
  24. ]
  25. USING_MICROLIB = [
  26. 'LPC812',
  27. ]
  28. FILE_TYPES = {
  29. 'c_sources':'1',
  30. 'cpp_sources':'8',
  31. 's_sources':'2'
  32. }
  33. def get_toolchain(self):
  34. return 'uARM' if (self.target in self.USING_MICROLIB) else 'ARM'
  35. def generate(self):
  36. source_files = []
  37. for r_type, n in DS5_5.FILE_TYPES.iteritems():
  38. for file in getattr(self.resources, r_type):
  39. source_files.append({
  40. 'name': basename(file), 'type': n, 'path': file
  41. })
  42. ctx = {
  43. 'name': self.program_name,
  44. 'include_paths': self.resources.inc_dirs,
  45. 'scatter_file': self.resources.linker_script,
  46. 'object_files': self.resources.objects + self.resources.libraries,
  47. 'source_files': source_files,
  48. 'symbols': self.get_symbols()
  49. }
  50. target = self.target.lower()
  51. # Project file
  52. self.gen_file('ds5_5_%s.project.tmpl' % target, ctx, '.project')
  53. self.gen_file('ds5_5_%s.cproject.tmpl' % target, ctx, '.cproject')
  54. self.gen_file('ds5_5_%s.launch.tmpl' % target, ctx, 'ds5_%s.launch' % target)