diff options
author | laforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-10-15 20:21:40 +0000 |
---|---|---|
committer | laforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-10-15 20:21:40 +0000 |
commit | 28eb4a57d93f2cf13d3693ce4dba677f22cbf1cc (patch) | |
tree | 3cc72ad1aeb7c543f91989d4cb055f06d81cd33f /firmware/src/picc/main_openpicc.c | |
parent | b2f42e7acf929490965348e826b5fa86c51515f5 (diff) |
- add svn:ignore property to make 'svn st' output more realistic
- remove old copy+paste+edit port of parts of librfid
- add ability to directly link librfid.a from mainline librfid
- make usb string descriptors optional again (config.h)
- fix TC_CDIV to reset correctly on swtrig (For OpenPICC)
- temporarily re-implement ep0_send_data() in pcd_enumerate.c
- make UDP_PUPv4 switching conditional to PCD
- introduce DEBUG_UNBUFFERED define in dbgu.c
- fix some signed/unsigned/typecast related compiler warnings
- remove dead code from src/os/led.c
- implement a 'mdelay' and 'usleep' stub function (FIXME!)
- rename rc632_... functions into opcd_rc632_... to avoid confusion
- introduce new 'main_librfid' TARGET
- make main_{reqa,analog} work with librfid rather than old code
- introduce mroe debugging options for FIQ handler code in Cstartup_app
- lots of PICC work that doesn't need comments now
git-svn-id: https://svn.openpcd.org:2342/trunk@266 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/picc/main_openpicc.c')
-rw-r--r-- | firmware/src/picc/main_openpicc.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/firmware/src/picc/main_openpicc.c b/firmware/src/picc/main_openpicc.c index df754de..ff89dc2 100644 --- a/firmware/src/picc/main_openpicc.c +++ b/firmware/src/picc/main_openpicc.c @@ -35,8 +35,8 @@ #include <picc/ssc_picc.h> #include <picc/load_modulation.h> -static const u_int16_t cdivs[] = { 128, 64, 32, 16 }; -static u_int8_t cdiv_idx = 0; +static const u_int16_t cdivs[] = { 8192, 2048, 1024, 512, 128, 64, 32, 16 }; +static u_int8_t cdiv_idx = 6; static u_int16_t duty_percent = 22; #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -53,12 +53,12 @@ void _init_func(void) poti_init(); load_mod_init(); tc_cdiv_init(); - //tc_fdt_init(); + tc_fdt_init(); pwm_init(); adc_init(); ssc_rx_init(); - // ssc_tx_init(); - + ssc_tx_init(); + /* high-level protocol */ decoder_init(); opicc_usbapi_init(); @@ -80,7 +80,7 @@ static void help(void) DEBUGPCR("v: decrease load_mod b: increase load_mod\r\n" "B: read button S: toggle nSLAVE_RESET\r\n" "a: SSC stop s: SSC start\r\n" - "d: SSC mode select"); + "d: SSC mode select T: TC_CDIV_HELP enable\r\n"); } int _main_dbgu(char key) @@ -88,6 +88,7 @@ int _main_dbgu(char key) static u_int8_t poti = 64; static u_int8_t pll_inh = 1; static u_int8_t ssc_mode = 1; + static u_int8_t sync_enabled = 0; DEBUGPCRF("main_dbgu"); @@ -218,12 +219,25 @@ int _main_dbgu(char key) ssc_rx_start(); break; case 'd': - ssc_rx_mode_set(++ssc_mode); + ssc_mode++; + if (ssc_mode >= 6) + ssc_mode = 0; + ssc_rx_mode_set(ssc_mode); DEBUGPCRF("SSC MODE %u", ssc_mode); break; + case 'T': + if (sync_enabled) { + tc_cdiv_sync_disable(); + sync_enabled = 0; + } else { + tc_cdiv_sync_enable(); + sync_enabled = 1; + } + break; } tc_cdiv_print(); + //tc_fdt_print(); return -EINVAL; } @@ -236,5 +250,6 @@ void _main_func(void) /* next we deal with incoming reqyests from USB EP1 (OUT) */ usb_in_process(); + udp_unthrottle(); ssc_rx_unthrottle(); } |