<commit_before>package bbhw

import (
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"strconv"
	"time"
)

//PWM lines

type BBPWMPin struct {
	fd_period   *os.File
	fd_duty     *os.File
	fd_polarity *os.File
}

type pwmchip struct {
	chip, pwm int
}

var pin_to_pwmchip_map_ = map[string]pwmchip{
	"P9_14": pwmchip{2, 0}, //EHRPWM1A
	"P9_16": pwmchip{2, 1}, //EHRPWM1B
	"P9_21": pwmchip{0, 1}, //EHRPWM0B
	"P9_22": pwmchip{0, 0}, //EHRPWM0A
	"P9_28": pwmchip{7, 0}, //ECAPPWM2
	"P9_29": pwmchip{0, 1}, //EHRPWM0B //same as P9_21
	"P9_31": pwmchip{0, 0}, //EHRPWM0A //same as P9_22
	"P9_42": pwmchip{6, 0}, //ECAPPWM0
	"P8_13": pwmchip{4, 1}, //EHRPWM2B
	"P8_19": pwmchip{4, 0}, //EHRPWM2A
	"P8_34": pwmchip{2, 1}, //EHRPWM1B //same as P9_16
	"P8_36": pwmchip{2, 0}, //EHRPWM1A //same as P9_14
	"P8_45": pwmchip{4, 0}, //EHRPWM2A // same as P8_19
	"P8_46": pwmchip{4, 1}, //EHRPWM2B // same as P8_13

}

func LoadOverlayForSysfsPWM() error {
	err := AddDeviceTreeOverlayIfNotAlreadyLoaded("am33xx_pwm")
	if err == ERROR_DTO_ALREADY_LOADED {
		return nil
	} else {
		return err
	}<commit_msg>fix pwm pin P8_19<commit_after>package bbhw

import (
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"strconv"
	"time"
)

//PWM lines

type BBPWMPin struct {
	fd_period   *os.File
	fd_duty     *os.File
	fd_polarity *os.File
}

type pwmchip struct {
	chip, pwm int
}

var pin_to_pwmchip_map_ = map[string]pwmchip{
	"P9_22": pwmchip{0, 0}, //EHRPWM0A
	"P9_31": pwmchip{0, 0}, //EHRPWM0A //same as P9_22
	"P9_21": pwmchip{0, 1}, //EHRPWM0B
	"P9_29": pwmchip{0, 1}, //EHRPWM0B //same as P9_21

	"P9_14": pwmchip{2, 0}, //EHRPWM1A
	"P8_36": pwmchip{2, 0}, //EHRPWM1A //same as P9_14
	"P9_16": pwmchip{2, 1}, //EHRPWM1B
	"P8_34": pwmchip{2, 1}, //EHRPWM1B //same as P9_16

	"P8_19": pwmchip{4, 0}, //EHRPWM2A
	"P8_45": pwmchip{4, 0}, //EHRPWM2A // same as P8_19
	"P8_13": pwmchip{4, 1}, //EHRPWM2B
	"P8_46": pwmchip{4, 1}, //EHRPWM2B // same as P8_13

	"P9_42": pwmchip{6, 0}, //ECAPPWM0
	"P9_28": pwmchip{7, 0}, //ECAPPWM2

}

func LoadOverlayForSysfsPWM() error {
	err := AddDeviceTreeOverlayIfNotAlreadyLoaded("am33xx_pwm")
	if err == ERROR_DTO_ALREADY_LOADED {
		return nil
	} else {
		return err
	}
{'fraction_non_alphanumeric': 0.17379310344827587, 'fraction_numerical': 0.09701149425287356, 'mean_word_length': 3.803532008830022, 'pattern_counts': {'":': 28, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4280685', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1146, 'n_words': 235}