1# Copyright 2022 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16include($ENV{PW_ROOT}/pw_thread_freertos/backend.cmake) 17 18pw_add_module_config(pw_thread_freertos_CONFIG) 19 20pw_add_library(pw_thread_freertos.config INTERFACE 21 HEADERS 22 public/pw_thread_freertos/config.h 23 PUBLIC_INCLUDES 24 public 25 PUBLIC_DEPS 26 pw_third_party.freertos 27 ${pw_thread_freertos_CONFIG} 28) 29 30# This target provides the backend for pw::thread::Id & pw::this_thread::get_id. 31pw_add_library(pw_thread_freertos.id INTERFACE 32 HEADERS 33 public/pw_thread_freertos/id_inline.h 34 public/pw_thread_freertos/id_native.h 35 id_public_overrides/pw_thread_backend/id_inline.h 36 id_public_overrides/pw_thread_backend/id_native.h 37 PUBLIC_INCLUDES 38 public 39 id_public_overrides 40 PUBLIC_DEPS 41 pw_assert 42 pw_interrupt.context 43 pw_third_party.freertos 44 pw_thread.id.facade 45) 46 47# This target provides the backend for pw::this_thread::sleep_{for,until}. 48pw_add_library(pw_thread_freertos.sleep STATIC 49 HEADERS 50 public/pw_thread_freertos/sleep_inline.h 51 sleep_public_overrides/pw_thread_backend/sleep_inline.h 52 PUBLIC_INCLUDES 53 public 54 sleep_public_overrides 55 PUBLIC_DEPS 56 pw_chrono.system_clock 57 pw_thread.sleep.facade 58 SOURCES 59 sleep.cc 60 PRIVATE_DEPS 61 pw_assert 62 pw_chrono_freertos.system_clock 63 pw_third_party.freertos 64 pw_thread.id 65) 66 67# This target provides the backend for pw::thread::Thread and the headers needed 68# for thread creation. 69pw_add_library(pw_thread_freertos.thread STATIC 70 HEADERS 71 public/pw_thread_freertos/context.h 72 public/pw_thread_freertos/options.h 73 public/pw_thread_freertos/thread_inline.h 74 public/pw_thread_freertos/thread_native.h 75 thread_public_overrides/pw_thread_backend/thread_inline.h 76 thread_public_overrides/pw_thread_backend/thread_native.h 77 PUBLIC_INCLUDES 78 public 79 thread_public_overrides 80 PUBLIC_DEPS 81 pw_assert 82 pw_span 83 pw_string 84 pw_third_party.freertos 85 pw_thread.id 86 pw_thread.thread.facade 87 pw_thread_freertos.config 88 SOURCES 89 thread.cc 90) 91 92# This target provides the backend for pw::this_thread::yield. 93pw_add_library(pw_thread_freertos.yield INTERFACE 94 HEADERS 95 public/pw_thread_freertos/yield_inline.h 96 yield_public_overrides/pw_thread_backend/yield_inline.h 97 PUBLIC_INCLUDES 98 public 99 yield_public_overrides 100 PUBLIC_DEPS 101 pw_assert 102 pw_third_party.freertos 103 pw_thread.id 104 pw_thread.yield.facade 105) 106 107pw_add_library(pw_thread_freertos.util STATIC 108 HEADERS 109 public/pw_thread_freertos/util.h 110 PUBLIC_INCLUDES 111 public 112 PUBLIC_DEPS 113 pw_third_party.freertos 114 pw_function 115 pw_span 116 pw_status 117 SOURCES 118 util.cc 119 PRIVATE_DEPS 120 pw_log 121) 122 123pw_add_library(pw_thread_freertos.snapshot STATIC 124 HEADERS 125 public/pw_thread_freertos/snapshot.h 126 PUBLIC_INCLUDES 127 public 128 PUBLIC_DEPS 129 pw_function 130 pw_span 131 pw_protobuf 132 pw_status 133 pw_third_party.freertos 134 pw_thread.protos.pwpb 135 pw_thread.snapshot 136 pw_thread_freertos.config 137 SOURCES 138 snapshot.cc 139 PRIVATE_DEPS 140 pw_thread_freertos.freertos_tsktcb 141 pw_thread_freertos.util 142 pw_log 143) 144 145pw_add_facade(pw_thread_freertos.freertos_tsktcb INTERFACE 146 BACKEND 147 pw_thread_freertos.freertos_tsktcb_BACKEND 148 HEADERS 149 public/pw_thread_freertos/freertos_tsktcb.h 150 PUBLIC_INCLUDES 151 public 152 PUBLIC_DEPS 153 pw_third_party.freertos 154) 155