diff --git a/application/main/CMakeLists.txt b/application/main/CMakeLists.txt index 1ec3a42b..418f1b23 100644 --- a/application/main/CMakeLists.txt +++ b/application/main/CMakeLists.txt @@ -10,6 +10,7 @@ include_directories(${MAIN_INCLUDE_PATH}) link_directories( ${LIBS_OUTPUT_PATH} + ${HAL_SOURCE_PATH}/include ) set(CMAKE_AUTOMOC ON) diff --git a/application/main/src/MainThread.cpp b/application/main/src/MainThread.cpp index 6abbec48..fdd4d911 100644 --- a/application/main/src/MainThread.cpp +++ b/application/main/src/MainThread.cpp @@ -14,6 +14,7 @@ */ #include "MainThread.h" #include "ILog.h" +#include "IHal.h" #include MainThread::MainThread() { mMainThreadRuning = false; } std::shared_ptr &MainThread::GetInstance(std::shared_ptr *impl) @@ -33,6 +34,7 @@ std::shared_ptr &MainThread::GetInstance(std::shared_ptr StatusCode MainThread::Init(void) { mMainThreadRuning = true; + CreateAllModules(); return CreateStatusCode(STATUS_CODE_OK); } StatusCode MainThread::UnInit(void) @@ -40,7 +42,11 @@ StatusCode MainThread::UnInit(void) DestoryAllModules(); return CreateStatusCode(STATUS_CODE_OK); } -StatusCode MainThread::CreateAllModules(void) { return CreateStatusCode(STATUS_CODE_OK); } +StatusCode MainThread::CreateAllModules(void) +{ + CreateHalModule(); + return CreateStatusCode(STATUS_CODE_OK); +} void MainThread::DestoryAllModules(void) {} void MainThread::ResetAllPtrMaker(void) {} void MainThread::Runing(void) diff --git a/hal/abstract/IHal.cpp b/hal/abstract/IHal.cpp index 681f38c5..0db46f6f 100644 --- a/hal/abstract/IHal.cpp +++ b/hal/abstract/IHal.cpp @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "IHal.h" #include "IHalCpp.h" #include "StatusCode.h" diff --git a/hal/abstract/IHalCpp.cpp b/hal/abstract/IHalCpp.cpp index 8e908df5..0e469e88 100644 --- a/hal/abstract/IHalCpp.cpp +++ b/hal/abstract/IHalCpp.cpp @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "IHalCpp.h" #include "ILog.h" #include diff --git a/hal/include/IHal.h b/hal/include/IHal.h index 071d11c5..f6bb7dc5 100644 --- a/hal/include/IHal.h +++ b/hal/include/IHal.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef IHAL_H #define IHAL_H #include "StatusCode.h" diff --git a/hal/include/IHalCpp.h b/hal/include/IHalCpp.h index 9f994020..625f7a34 100644 --- a/hal/include/IHalCpp.h +++ b/hal/include/IHalCpp.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef IHALCPP_H #define IHALCPP_H #include "StatusCode.h" diff --git a/hal/src/Hal.c b/hal/src/Hal.c index 6e6f8d55..72f1c44b 100644 --- a/hal/src/Hal.c +++ b/hal/src/Hal.c @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "Hal.h" #include "ILog.h" #include @@ -31,7 +45,6 @@ StatusCode NewHal(Hal **hal) LogError("NewHal failed.\n"); return CreateStatusCode(STATUS_CODE_NOT_OK); } - // else { HalImplInit(*hal); return CreateStatusCode(STATUS_CODE_OK); diff --git a/hal/src/Hal.h b/hal/src/Hal.h index 90f14836..184d1078 100644 --- a/hal/src/Hal.h +++ b/hal/src/Hal.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef HAL_H #define HAL_H #include "IHal.h" diff --git a/hal/src/HalCpp.cpp b/hal/src/HalCpp.cpp index 33e4aeb8..ba77430d 100644 --- a/hal/src/HalCpp.cpp +++ b/hal/src/HalCpp.cpp @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "HalCpp.h" #include "ILog.h" StatusCode HalCpp::Init(void) diff --git a/hal/src/HalCpp.h b/hal/src/HalCpp.h index 312b5a11..24a5b12f 100644 --- a/hal/src/HalCpp.h +++ b/hal/src/HalCpp.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef HALCPP_H #define HALCPP_H #include "IHalCpp.h" diff --git a/hal/src/HalMakePtr.cpp b/hal/src/HalMakePtr.cpp index 5f8daf76..71ac6dc2 100644 --- a/hal/src/HalMakePtr.cpp +++ b/hal/src/HalMakePtr.cpp @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "HalMakePtr.h" #include "Hal.h" #include "HalCpp.h" diff --git a/hal/src/HalMakePtr.h b/hal/src/HalMakePtr.h index 2a123953..a35df79d 100644 --- a/hal/src/HalMakePtr.h +++ b/hal/src/HalMakePtr.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2023 Fancy Code. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef HALMAKEPTR_H #define HALMAKEPTR_H #include "IHal.h"