Compare commits

..

No commits in common. "73dee871903c3d862dbed3bac59696b85c5b221f" and "09f214efbec2c9155ebb9f172e759c7e86a544ff" have entirely different histories.

5 changed files with 13 additions and 10 deletions

4
ADC.c
View file

@ -35,8 +35,8 @@ void ADC_Init(uint8_t pin_num)
RegEdit_SetBit((void *) &PORTA.OUTCLR, pin_num);
//Disable input buffer
//We do some kind of nasty address addition but it saves
//memory and means we don't need a switch statement.
//We do some kinda nasty address addition but it saves
//memory and means we don't need a switch statment.
//PORT_ISC_INPUT_DISABLE_gc
RegEdit_SetBit(
(void *) (&PORTA.PIN0CTRL)+pin_num,

4
load.c
View file

@ -16,9 +16,9 @@ void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
ADC_Enable(adc_pin);
uint16_t val;
for(int i = 0; i < 32; i++){
val = ADC_ReadValue(adc_pin);
val += ADC_ReadValue(adc_pin);
}
val /= 32;
ADC_Disable();
if(val < 527 || val > 1000){
RegEdit_ClearBit((void *) &PORTA.OUT, out_pin);

5
main.c
View file

@ -9,8 +9,7 @@
* extracted into separate source files and headers for configuration.
*/
//#define F_CPU 2000000UL
#define F_CPU 3333333UL
#define F_CPU 2000000UL
//These defines are mostly useful for when you want you editors LSP server to
//function correctly.
@ -47,7 +46,7 @@ static void CLK_DisablePrescaler(void)
int main(int argc, char **argv)
{
//CLK_DisablePrescaler();
CLK_DisablePrescaler();
while(true){
for(int i = 0; i < GatePulsesQty; i++){
ZCD_Poll();

View file

@ -1,11 +1,11 @@
#
#Mon Jul 15 11:39:10 PDT 2024
#Tue Jul 02 16:53:25 PDT 2024
attiny404.com-microchip-mplab-mdbcore-PK5Tool-PK5ToolImpl.md5=8ed9aa4326bfc0c1a849e697826741b7
attiny404.languagetoolchain.version=2.46
attiny404.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=bf89cdcdd6c0a49174fe4b605ef2b42d
conf.ids=,attiny404
host.id=2ov5-ff4p-rv
configurations-xml=a8df58f0d8aebafa503466e35cdcf228
configurations-xml=612d34b4ce82b1d02e7fec601f793556
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321
attiny404.languagetoolchain.dir=/opt/microchip/xc8/v2.46/bin
proj.dir=/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X

View file

@ -212,6 +212,8 @@
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-7ff"/>
<property key="poweroptions.powerenable" value="true"/>
<property key="programmerToGoFilePath"
value="/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/debug/default/fg004a_ptg"/>
<property key="programmerToGoImageName" value="fg004a_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
@ -445,7 +447,7 @@
<property key="communication.speed" value="0.250"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="debugoptions.useswbreakpoints" value="true"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
@ -465,6 +467,8 @@
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-7ff"/>
<property key="poweroptions.powerenable" value="true"/>
<property key="programmerToGoFilePath"
value="/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/debug/attiny404/fg004a_ptg"/>
<property key="programmerToGoImageName" value="fg004a_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>