Skip to content

Commit

Permalink
Remove header guard cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Aug 21, 2023
1 parent 865d04c commit 2ef77ec
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions build/chip/write_build_time_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def utc_time_in_matter_epoch_s():


class Options:
def __init__(self, output, header_guard, define_name, define_val):
def __init__(self, output, define_name, define_val):
self.output = output
self.header_guard = header_guard
self.define_name = define_name
self.define_val = define_val

Expand All @@ -40,20 +39,13 @@ def GetOptions():
help="Path to root of generated file directory tree.")
cmdline_options = parser.parse_args()

# Compute header guard by replacing some chars with _ and upper-casing.
header_guard = cmdline_options.output.upper()
header_guard = \
header_guard.replace('/', '_').replace('\\', '_').replace('.', '_')
header_guard += '_'

# The actual output file is inside the gen dir.
output = os.path.join(cmdline_options.gen_dir, cmdline_options.output)

define_name = 'CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME_MATTER_EPOCH_S'
build_time = utc_time_in_matter_epoch_s()

return Options(output=output,
header_guard=header_guard,
define_name=define_name,
define_val=str(build_time))

Expand Down

0 comments on commit 2ef77ec

Please sign in to comment.