-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add arm-linux build for RPi2 and fix for nuttx build
IoT.js-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
- Loading branch information
1 parent
a4e1cf2
commit d41b086
Showing
10 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2015 Samsung Electronics Co., Ltd. | ||
# | ||
# 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(CMakeForceCompiler) | ||
|
||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR armv7l-hf) | ||
|
||
set(EXTERNAL_CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) | ||
set(EXTERNAL_CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) | ||
|
||
CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} GNU) | ||
CMAKE_FORCE_CXX_COMPILER(${EXTERNAL_CMAKE_CXX_COMPILER} GNU) | ||
|
||
set(FLAGS_COMMON -mlittle-endian | ||
-mthumb | ||
-mfpu=vfpv3-d16 | ||
-D__LINUX__ | ||
-D__ARM__) | ||
|
||
foreach(FLAG ${FLAGS_COMMON}) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") | ||
endforeach() | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* Copyright 2015 Samsung Electronics Co., Ltd. | ||
* | ||
* 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 "iotjs_def.h" | ||
#include "iotjs_module_gpioctl.h" | ||
|
||
|
||
namespace iotjs { | ||
|
||
|
||
class GpioControlInst : public GpioControl { | ||
public: | ||
explicit GpioControlInst(JObject& jgpioctl); | ||
virtual int Initialize(void); | ||
virtual void Release(void); | ||
virtual int PinMode(uint32_t portpin); | ||
virtual int WritePin(uint32_t portpin, uint8_t data); | ||
virtual int ReadPin(uint32_t portpin, uint8_t* pdata); | ||
}; | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
GpioControl* GpioControl::Create(JObject& jgpioctl) | ||
{ | ||
return new GpioControlInst(jgpioctl); | ||
} | ||
|
||
|
||
GpioControlInst::GpioControlInst(JObject& jgpioctl) | ||
: GpioControl(jgpioctl) { | ||
} | ||
|
||
|
||
int GpioControlInst::Initialize(void) { | ||
if (_fd > 0 ) | ||
return IOTJS_GPIO_INUSE; | ||
|
||
_fd = 1; | ||
return _fd; | ||
} | ||
|
||
|
||
void GpioControlInst::Release(void) { | ||
_fd = 0; | ||
} | ||
|
||
|
||
int GpioControlInst::PinMode(uint32_t portpin) { | ||
if (_fd <= 0) | ||
return IOTJS_GPIO_NOTINITED; | ||
return 0; | ||
} | ||
|
||
|
||
int GpioControlInst::WritePin(uint32_t portpin, uint8_t data) { | ||
if (_fd <= 0) | ||
return IOTJS_GPIO_NOTINITED; | ||
return 0; | ||
} | ||
|
||
|
||
int GpioControlInst::ReadPin(uint32_t portpin, uint8_t* pdata) { | ||
if (_fd <= 0) | ||
return IOTJS_GPIO_NOTINITED; | ||
return 0; | ||
} | ||
|
||
|
||
} // namespace iotjs |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters