You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
964 B
36 lines
964 B
package hdmicec
|
|
import (
|
|
"android/soong/android"
|
|
"android/soong/cc"
|
|
// "fmt"
|
|
"strings"
|
|
)
|
|
func init() {
|
|
//fmt.Println("hdmicec module init start")
|
|
android.RegisterModuleType("hdmicec", DefaultsFactory)
|
|
}
|
|
func DefaultsFactory() (android.Module) {
|
|
module := cc.DefaultsFactory()
|
|
android.AddLoadHook(module, Defaults)
|
|
return module
|
|
}
|
|
func Defaults(ctx android.LoadHookContext) {
|
|
type props struct {
|
|
Cflags []string
|
|
}
|
|
p := &props{}
|
|
p.Cflags = globalDefaults(ctx)
|
|
ctx.AppendProperties(p)
|
|
}
|
|
func globalDefaults(ctx android.BaseContext) ([]string) {
|
|
var cppflags []string
|
|
// fmt.Println("HDMI_PORT_TYPE:",
|
|
// ctx.AConfig().Getenv("HDMI_PORT_TYPE"))
|
|
if strings.EqualFold(ctx.AConfig().Getenv("HDMI_PORT_TYPE"),"in") {
|
|
cppflags = append(cppflags,"-DHDMI_PORT_TYPE=in")
|
|
}else{
|
|
cppflags = append(cppflags,"-DHDMI_PORT_TYPE=out")
|
|
}
|
|
return cppflags
|
|
}
|