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.deprecated_or_new_thread_function 87 pw_thread.thread.facade 88 pw_thread_freertos.config 89 SOURCES 90 thread.cc 91) 92 93# This target provides the backend for pw::this_thread::yield. 94pw_add_library(pw_thread_freertos.yield INTERFACE 95 HEADERS 96 public/pw_thread_freertos/yield_inline.h 97 yield_public_overrides/pw_thread_backend/yield_inline.h 98 PUBLIC_INCLUDES 99 public 100 yield_public_overrides 101 PUBLIC_DEPS 102 pw_assert 103 pw_third_party.freertos 104 pw_thread.id 105 pw_thread.yield.facade 106) 107 108pw_add_library(pw_thread_freertos.util STATIC 109 HEADERS 110 public/pw_thread_freertos/util.h 111 PUBLIC_INCLUDES 112 public 113 PUBLIC_DEPS 114 pw_third_party.freertos 115 pw_function 116 pw_span 117 pw_status 118 SOURCES 119 util.cc 120 PRIVATE_DEPS 121 pw_log 122) 123 124pw_add_library(pw_thread_freertos.snapshot STATIC 125 HEADERS 126 public/pw_thread_freertos/snapshot.h 127 PUBLIC_INCLUDES 128 public 129 PUBLIC_DEPS 130 pw_function 131 pw_span 132 pw_protobuf 133 pw_status 134 pw_third_party.freertos 135 pw_thread.protos.pwpb 136 pw_thread.snapshot 137 pw_thread_freertos.config 138 SOURCES 139 snapshot.cc 140 PRIVATE_DEPS 141 pw_thread_freertos.freertos_tsktcb 142 pw_thread_freertos.util 143 pw_log 144) 145 146pw_add_facade(pw_thread_freertos.freertos_tsktcb INTERFACE 147 BACKEND 148 pw_thread_freertos.freertos_tsktcb_BACKEND 149 HEADERS 150 public/pw_thread_freertos/freertos_tsktcb.h 151 PUBLIC_INCLUDES 152 public 153 PUBLIC_DEPS 154 pw_third_party.freertos 155) 156